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 | |
# gtk-theme-swatch: A PyGtk widget that displays the color swatches of all | |
# gtk.Styles, in all states. Useful for designing themes | |
# author: John Stowers <[email protected]> | |
import gtk | |
class ThemeSwatch(gtk.DrawingArea): | |
SWATCH_SIZE = 50 #swatch size |
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
# Demo application showing how once can combine the python | |
# threading module with GObject signals to make a simple thread | |
# manager class which can be used to stop horrible blocking GUIs. | |
# | |
# (c) 2008, John Stowers <[email protected]> | |
# | |
# This program serves as an example, and can be freely used, copied, derived | |
# and redistributed by anyone. No warranty is implied or given. | |
import gtk | |
import gobject |
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 | |
# Python example demonstrating when callbacks are run in a threaded environment | |
# John Stowers | |
import threading | |
import thread | |
import time | |
import gobject | |
import gtk | |
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 | |
# Prints the memory usage (including private and dirty) for a given PID | |
# | |
import sys | |
import re | |
def permute(args): | |
ret = [] | |
if args: |
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 | |
""" | |
Animated Gtk+ StatusIcon | |
Given an icon name or path, animates the icon in a number of ways, rotating, | |
shrinking, saturating it, etc. | |
Inspiration from: | |
http://groups.google.com/group/sage-devel/browse_thread/thread/f9aeba22ac171082 | |
""" |
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 | |
# Demo for testing gtk.Curve | |
# John Stowers 2009 | |
import random | |
import gtk | |
class UI: | |
TYPES = (gtk.CURVE_TYPE_LINEAR, gtk.CURVE_TYPE_SPLINE, gtk.CURVE_TYPE_FREE) |
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 | |
# A simple example of using multiple rtgraph HScrollLineGraph widgets | |
# Micah Dowty <[email protected]>, John Stowers | |
# | |
import gtk | |
import time, math, re | |
import gs.ui.rtgraph as rtgraph | |
windows = [] |
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 | |
# This module provides a 'with' for using curses in Python. | |
# from: http://www.finalcog.com/python-with-curses-with_curses | |
from __future__ import with_statement | |
import curses | |
class WithCurses(object): | |
""" |
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 | |
# This function prints the difference between two python datetime objects | |
# in a more human readable form | |
# | |
# Adapted from: http://www.chimeric.de/blog/2008/0711_smart_dates_in_python | |
def humanize_date_difference(now, otherdate=None, offset=None): | |
if otherdate: | |
dt = otherdate - now | |
offset = dt.seconds + (dt.days * 60*60*24) |
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 | |
# Update or add copyright headers to source files. | |
# John Stowers | |
import os | |
new_licence = """ * | |
* This file is part of wasp, some code taken from paparazzi (GPL) | |
* | |
* wasp is free software; you can redistribute it and/or modify |
OlderNewer