This file contains hidden or 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
""" I needed some unique icons for numerous pyside scripts. This helped. | |
""" | |
from PySide import QtCore, QtGui | |
import sys | |
import operator | |
def getIcon(inputStr='', saturation=.8, value=.9, size=128): | |
""" Creates a QIcon of a single letter on a solid color based on an input | |
string. The same string will always produce the same background color. |
This file contains hidden or 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
""" | |
Flip slashes in ClipBoard | |
Now using Tk, so it should be cross-platform. | |
http://stackoverflow.com/questions/579687 | |
""" | |
from Tkinter import Tk | |
w = Tk() # create window object | |
w.withdraw() # hide window from view. |
This file contains hidden or 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 | |
import getpass | |
sentry_url = 'http://<hash>:<hash>@sentry-server.local/1' | |
try: | |
import raven | |
RAVEN_CLIENT = raven.Client(sentry_url) | |
RAVEN_CLIENT.tags_context({'user':getpass.getuser()}) | |
except: | |
RAVEN_CLIENT = None | |
This file contains hidden or 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 os | |
import sys | |
import grp | |
import pwd | |
import re | |
import tempfile | |
import shutil | |
import getpass | |
import logging |
This file contains hidden or 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
# http://docs.thefoundry.co.uk/nuke/63/pythondevguide/flipbook.html | |
# Copyright (c) 2010 The Foundry Visionmongers Ltd. All Rights Reserved. | |
import glob | |
import os.path | |
import platform | |
import re | |
import subprocess | |
import sys | |
import thread |
This file contains hidden or 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
if [ -r ~/.ssh/known_hosts ]; then | |
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e 's/,.*//g' | uniq | grep -v "\["`;)" ssh | |
fi |
This file contains hidden or 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 | |
import argparse | |
import requests | |
import logging | |
LOG = logging.getLogger("slack_leaver") | |
class JSONRest(object): | |
def __init__(self, base_url): |
This file contains hidden or 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
""" Add the QWebEngineView | |
Requires Qt.py >=1.1.0 | |
""" | |
import logging | |
LOG = logging.getLogger('tx.QtSiteConfig') | |
def update_members(members): | |
LOG.debug("update_members") | |
members['QtWebEngineWidgets'] = ["QWebEngineView","QWebEnginePage"] |
This file contains hidden or 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
""" Test for drawing base64 image strings for job progress | |
Example Job: | |
{ | |
'comment': '', | |
'maxslots': 0, | |
'numblocked': 0, | |
'spoolcwd': '/home/freddie/unitard, | |
'numerror': 0, | |
'aftertime': None, |
OlderNewer