Skip to content

Instantly share code, notes, and snippets.

View baijum's full-sized avatar
🏠
Working from home

Baiju Muthukadan baijum

🏠
Working from home
  • Red Hat
  • India
View GitHub Profile
(Pdb) elem = browser.find_element_by_xpath("//button[@value='Search']")
(Pdb) elem.click()
*** ElementNotVisibleException: Message: u'Element is not currently visible and so may not be interacted with' ; Stacktrace: Method WebDriverError threw an error in file:///tmp/tmpYesMjt/extensions/[email protected]/resource/modules/atoms.js
(Pdb) elem.size
{'width': 0, 'height': 0}
@baijum
baijum / amazon_sender.py
Created November 5, 2011 06:39 — forked from amix/amazon_sender.py
Amazon SES helper script using boto
# -*- coding: utf-8 -*-
"""
amazon_sender.py
~~~~~~~~
Python helper class that can send emails using Amazon SES and boto.
The biggest feature of this class is that encodings are handled properly.
It can send both text and html emails.
This implementation is using Python's standard library (which opens up for a lot more options).
Test Gist
import socket
HOST, PORT = "localhost", 9999
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((HOST, PORT))
sock.send("get" + "\n")
import time
import pytest
def pytest_configure_node(node):
node.slaveinput['all_nodes'] = {'a': True, 'b': True, 'c': True}
node.slaveinput['used_nodes'] = {}
def _get_browser(request):
def get_browser():
class Browser(object):
@baijum
baijum / python-pep8.el
Created April 12, 2012 09:25 — forked from ieure/python-pep8.el
Run pep8.py on Python source in Emacs.
;;; python-pep8.el --- minor mode for running `pep8'
;; Copyright (c) 2009, 2010 Ian Eure <[email protected]>
;; Author: Ian Eure <[email protected]>
;; Keywords: languages python
;; Last edit: 2010-02-12
;; Version: 1.01
@baijum
baijum / pyclip.py
Created April 23, 2012 15:06
Programmable clipboad for Windows
import win32clipboard, win32con
def get_pattern():
text = str(eval(raw_input("Pattern:\n")))
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(text)
win32clipboard.CloseClipboard()
@baijum
baijum / salt_traceback.txt
Created May 4, 2012 15:10
Salt test failure
======================================================================
FAIL: test_list_functions (sysmod.SysModuleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/baiju/salt/tests/integration/modules/sysmod.py", line 17, in test_list_functions
self.assertTrue('pkg.install' in funcs)
AssertionError: False is not True
======================================================================
FAIL: test_list_modules (sysmod.SysModuleTest)
@baijum
baijum / pyximport.diff
Created May 13, 2012 17:49
Add missing import of `pyximport`
From ceaeb945ee2e1c57715e3d37df0a2b6f21bba212 Mon Sep 17 00:00:00 2001
From: Baiju Muthukadan <[email protected]>
Date: Mon, 14 May 2012 04:46:39 +0530
Subject: [PATCH] Add missing import of `pyximport`
---
salt/loader.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/salt/loader.py b/salt/loader.py
Exception : [Error 53] The network path was not found: '\\\\\\etc\\salt\\pki'