This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import filterList | |
import mox | |
class TestFilterList(unittest.TestCase): | |
""" docstring for TestFilterList | |
""" | |
def setUp(self): | |
self._filterby = 'B' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Namespace(object): | |
"""Mock for argparse's NameSpace | |
""" | |
def __init__(self, lst=None, flter=None): | |
super(Namespace, self).__init__() | |
self.filter = flter | |
self.lst = lst | |
def __repr__(self): | |
return 'Namespace(filter=self.filter, lst = self.lst)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SlideShowPics(QtGui.QWidget): | |
"""docstring for SlideShowPics""" | |
def __init__(self, path): | |
super(SlideShowPics, self).__init__() | |
QtGui.QWidget.__init__(self, None, QtCore.Qt.WindowStaysOnTopHint) | |
self._path = path | |
self.setStyleSheet("QWidget{background-color: #000000;}") | |
self.animFlag = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt4 import QtCore,QtGui | |
import sys | |
class AnimatedWindow(QtGui.QWidget): | |
"""docstring for AnimatedWindow""" | |
def __init__(self, parent = None): | |
super(AnimatedWindow, self).__init__(parent) | |
animation = QtCore.QPropertyAnimation(self, "windowOpacity") | |
animation.setDuration(1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt4 import QtCore, QtGui | |
class MessageBox(QtGui.QDialog): | |
"""docstring for MessageBox""" | |
def __init__(self, data=None, parent=None): | |
super(MessageBox, self).__init__(parent) | |
self._data = data | |
self.buildUi() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getHtml(diffData): | |
""" This method convertes git diff data to html color code | |
""" | |
openTag = "<span style='font-size: .80em; color: " | |
openTagEnd = ";font-family: courier, arial, helvetica, sans-serif;'>" | |
nbsp = ' ' | |
return ''.join([("%s%s%s%s%s</span><br>" % (openTag, '#ff0000' if line.startswith('-') else ('#007900' if line.startswith('+') else '#000000'), openTagEnd, nbsp*line.count('\t') ,line)) for line in diffData]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright (C) 2006 by Johannes Zellner, <johannes@zellner.org> | |
# modified by mac@calmar.ws to fit my output needs | |
# modified by crncosta@carloscosta.org to fit my output needs | |
# Source: http://emerg3nc3.wordpress.com/2012/07/28/full-256-color-support-for-vim-andor-xterm-on-ubuntu-12-04/ | |
import sys | |
import os | |
def echo(msg): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nuke | |
import nukescripts | |
import re | |
class TriagePanel(nukescripts.PythonPanel): | |
def __init__(self): | |
nukescripts.PythonPanel.__init__(self, 'TriagePanel', 'com.ohufx.TriagePanel') | |
self.convergence = nuke.Double_Knob( 'convergence' ) | |
self.convergence.setRange( -20, 20) | |
self.LogTolin = nuke.Boolean_Knob("LogTolin/enable specifed nodes","LogTolin") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
week = ['Sun', 'Mon', 'Tue', 'Wed', 'Thurs', 'Fri'] | |
print "If you break out of For else doesnt execute becuase its a part of for loop." | |
print "Enter something/ some single letter." | |
var = raw_input('>>') | |
msg = '' | |
for day in week: | |
print day | |
if day.endswith(var): | |
break | |
msg = "No day ends with %s" % var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
value = None | |
try: | |
print "in try" | |
value = int(input()) | |
print "No Error Occured" | |
except: | |
print "In Except: Value: %s" % value | |
else: | |
print "In else: Value %s" % value |