From 17446122fe597dfc63a0b74226d42fe9efcf2eaf Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 22 Feb 2009 21:59:21 +0100 Subject: cleaned up --- python/1.py | 7 ---- python/shutdown.py.old | 88 -------------------------------------------------- 2 files changed, 95 deletions(-) delete mode 100644 python/1.py delete mode 100644 python/shutdown.py.old diff --git a/python/1.py b/python/1.py deleted file mode 100644 index 4c35ed0..0000000 --- a/python/1.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/python - -import sys - -action = sys.stdin.read() -action = action + "blub" + "foo" -print action diff --git a/python/shutdown.py.old b/python/shutdown.py.old deleted file mode 100644 index 0d3696d..0000000 --- a/python/shutdown.py.old +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python - -import sys -import getopt -import gtk - -class MessageBox(gtk.Dialog): - def __init__(self, message="", buttons=(), pixmap=None, - modal= True): - gtk.Dialog.__init__(self) - self.connect("destroy", self.quit) - self.connect("delete_event", self.quit) - if modal: - self.set_modal(True) - hbox = gtk.HBox(spacing=0) - hbox.set_border_width(0) - self.vbox.pack_start(hbox) - hbox.show() - if pixmap: - self.realize() - pixmap = Pixmap(self, pixmap) - hbox.pack_start(pixmap, expand=False) - pixmap.show() -# label = gtk.Label(message) -# hbox.pack_start(label) -# label.show() - for text in buttons: - b = gtk.Button(text) - b.set_flags(gtk.CAN_DEFAULT) - b.set_data("user_data", text) - b.connect("clicked", self.click) - self.action_area.pack_start(b) - b.show() - self.ret = None - def quit(self, *args): - self.hide() - self.destroy() - gtk.main_quit() - def click(self, button): - self.ret = button.get_data("user_data") - self.quit() - -# create a message box, and return which button was pressed -def message_box(title="Message Box", message="", buttons=(), pixmap=None, - modal= gtk.TRUE): - win = MessageBox(message, buttons, pixmap=pixmap, modal=modal) - win.set_title(title) - win.show() - gtk.main() - return win.ret - -def test(): - result = message_box(title='', - message='', - buttons=('Cancel', 'Reboot', 'Suspend', 'Halt')) - print 'result:', result - -USAGE_TEXT = """ -Usage: - python simple_dialog.py [options] -Options: - -h, --help Display this help message. -Example: - python simple_dialog.py -""" - -def usage(): - print USAGE_TEXT - sys.exit(-1) - -def main(): - args = sys.argv[1:] - try: - opts, args = getopt.getopt(args, 'h', ['help']) - except: - usage() - relink = 1 - for opt, val in opts: - if opt in ('-h', '--help'): - usage() - if len(args) != 0: - usage() - test() - -if __name__ == '__main__': - main() - #import pdb - #pdb.run('main()') -- cgit v1.2.3-24-g4f1b