commit 29310b85e2f48db4a61acb14fa349412e4eb2839 Author: Jim Infield Date: Thu Jan 1 12:00:00 2009 -0600 import of old work diff --git a/Denso/SimpleGladeApp.py b/Denso/SimpleGladeApp.py new file mode 100644 index 0000000..9e66196 --- /dev/null +++ b/Denso/SimpleGladeApp.py @@ -0,0 +1,115 @@ +# SimpleGladeApp.py +# Module that provides an object oriented abstraction to pygtk and libglade. +# Copyright (C) 2004 Sandino Flores Moreno + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +try: + import os + import sys + import gtk + import gtk.glade +except ImportError: + print "Error importing pygtk2 and pygtk2-libglade" + sys.exit(1) + +class SimpleGladeApp(dict): + def __init__(self, glade_filename, main_widget_name=None, domain=None): + gtk.glade.set_custom_handler(self.custom_handler) + if os.path.isfile(glade_filename): + self.glade_path = glade_filename + else: + glade_dir = os.path.split( sys.argv[0] )[0] + self.glade_path = os.path.join(glade_dir, glade_filename) + self.glade = gtk.glade.XML(self.glade_path, main_widget_name, domain) + if main_widget_name: + self.main_widget = self.glade.get_widget(main_widget_name) + else: + self.main_widget = None + self.signal_autoconnect() + self.new() + + def signal_autoconnect(self): + signals = {} + for attr_name in dir(self): + attr = getattr(self, attr_name) + if callable(attr): + signals[attr_name] = attr + self.glade.signal_autoconnect(signals) + + def custom_handler(self, + glade, function_name, widget_name, + str1, str2, int1, int2): + if hasattr(self, function_name): + handler = getattr(self, function_name) + return handler(str1, str2, int1, int2) + + def __getattr__(self, data_name): + if data_name in self: + data = self[data_name] + return data + else: + widget = self.glade.get_widget(data_name) + if widget != None: + self[data_name] = widget + return widget + else: + raise AttributeError, data_name + + def __setattr__(self, name, value): + self[name] = value + + def new(self): + pass + + def on_keyboard_interrupt(self): + pass + + def gtk_widget_show(self, widget, *args): + widget.show() + + def gtk_widget_hide(self, widget, *args): + widget.hide() + + def gtk_widget_grab_focus(self, widget, *args): + widget.grab_focus() + + def gtk_widget_destroy(self, widget, *args): + widget.destroy() + + def gtk_window_activate_default(self, widget, *args): + widget.activate_default() + + def gtk_true(self, *args): + return gtk.TRUE + + def gtk_false(self, *args): + return gtk.FALSE + + def gtk_main_quit(self, *args): + gtk.main_quit() + + def main(self): + gtk.main() + + def quit(self): + gtk.main_quit() + + def run(self): + try: + self.main() + except KeyboardInterrupt: + self.on_keyboard_interrupt() diff --git a/Denso/SimpleGladeApp.pyc b/Denso/SimpleGladeApp.pyc new file mode 100644 index 0000000..88209ee Binary files /dev/null and b/Denso/SimpleGladeApp.pyc differ diff --git a/Denso/denso.glade b/Denso/denso.glade new file mode 100644 index 0000000..6286848 --- /dev/null +++ b/Denso/denso.glade @@ -0,0 +1,190 @@ + + + + + + + True + Denso Activity Report Scan + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + GTK_CALENDAR_SHOW_HEADING|GTK_CALENDAR_SHOW_DAY_NAMES + + + + 0 + True + True + + + + + + True + <b>Select the date of the +report you are scanning</b> + False + True + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 6 + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_SPREAD + 0 + + + + 6 + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + + + + + + + 6 + True + True + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-apply + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Scan + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + + + 0 + True + True + + + + + + True + False + + + 0 + False + False + + + + + + + diff --git a/Denso/denso.gladep b/Denso/denso.gladep new file mode 100644 index 0000000..b675e95 --- /dev/null +++ b/Denso/denso.gladep @@ -0,0 +1,8 @@ + + + + + Denso + denso + FALSE + diff --git a/Denso/denso.py b/Denso/denso.py new file mode 100755 index 0000000..f865596 --- /dev/null +++ b/Denso/denso.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: UTF8 -*- + +# Python module denso.py +# Autogenerated from denso.glade +# Generated on Mon Mar 28 09:49:06 2005 + +# Warning: Do not delete or modify comments related to context +# They are required to keep user's code + +import os, gtk +from SimpleGladeApp import SimpleGladeApp + +glade_dir = "" + +# Put your modules and data here +selected = False + +# From here through main() codegen inserts/updates a class for +# every top-level widget in the .glade file. + +class Window1(SimpleGladeApp): + def __init__(self, glade_path="denso.glade", root="window1", domain=None): + glade_path = os.path.join(glade_dir, glade_path) + SimpleGladeApp.__init__(self, glade_path, root, domain) + + def new(self): + #context Window1.new { + pass + #context Window1.new } + + #context Window1 custom methods { + + def scan(self): + id = self.status.get_context_id("scan") + self.status.push(id, "Scanning...") + scanargs = '--brightness 30 --mode Gray --resolution 160' + scanpnm = 'scanimage %s > %s%s' % (scanargs,temp,pnmfile) + os.system(scanpnm) + + def convert(self): + id = self.status.get_context_id("scan") + self.status.push(id, "Converting...") + convert = 'pnmscale 0.5 %s%s | pnmtojpeg > %s%s' % (temp,pnmfile,path,jpgfile) + cleanup = 'rm -f %s%s' % (temp,pnmfile) + os.system(convert) + os.system(cleanup) + + #context Window1 custom methods } + + def on_calendar_day_selected(self, widget, *args): + #context Window1.on_calendar_day_selected { + global file, temp, path, selected, pnmfile, jpgfile + year,month,day = self.calendar.get_date() + mo = month + 1 + dy = day + yr = year - 2000 + path = '~/Denso/' + temp = '/tmp/' + file = 'dar%02d%02d%02d' % (mo,dy,yr) + selection = '%02d/%02d/%02d' % (mo,dy,yr) + pnmfile = file + '.pnm' + jpgfile = file + '.jpg' + id = self.status.get_context_id("select") + self.status.push(id, selection) + selected = True + #context Window1.on_calendar_day_selected } + + def on_scan_clicked(self, widget, *args): + #context Window1.on_scan_clicked { + id = self.status.get_context_id("click") + if not selected: + self.status.push(id, "Please select a date first!") + else: + self.scan() + self.convert() + result = 'Saved: %s%s' % (path,jpgfile) + self.status.push(id, result) + #context Window1.on_scan_clicked } + +def main(): + window1 = Window1() + window1.run() + +if __name__ == "__main__": + main() diff --git a/Denso/scanLegal.sh b/Denso/scanLegal.sh new file mode 100755 index 0000000..24331cb --- /dev/null +++ b/Denso/scanLegal.sh @@ -0,0 +1,2 @@ +#!/bin/sh +scanimage --brightness 30 --mode Gray --resolution 160 | pnmtojpeg >legalScan.jpg diff --git a/Denso/scanLetter.sh b/Denso/scanLetter.sh new file mode 100755 index 0000000..c85abb6 --- /dev/null +++ b/Denso/scanLetter.sh @@ -0,0 +1,2 @@ +#!/bin/sh +scanimage -y 279.3 --brightness 30 --mode Gray --resolution 160 | pnmtojpeg >letterScan.jpg diff --git a/Denso/simple-glade-codegen.py b/Denso/simple-glade-codegen.py new file mode 100755 index 0000000..143da7e --- /dev/null +++ b/Denso/simple-glade-codegen.py @@ -0,0 +1,442 @@ +#!/usr/bin/env python + +# simple-glade-codegen.py +# A code generator that uses pygtk, glade and SimpleGladeApp.py +# Copyright (C) 2004 Sandino Flores Moreno + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +import sys, os, re, codecs +import tokenize, shutil, time +import xml.sax +from xml.sax._exceptions import SAXParseException + +header_format = """\ +#!/usr/bin/env python +# -*- coding: UTF8 -*- + +# Python module %(module)s.py +# Autogenerated from %(glade)s +# Generated on %(date)s + +# Warning: Do not delete or modify comments related to context +# They are required to keep user's code + +import os, gtk +from SimpleGladeApp import SimpleGladeApp + +glade_dir = "" + +# Put your modules and data here + +# From here through main() codegen inserts/updates a class for +# every top-level widget in the .glade file. + +""" + +class_format = """\ +class %(class)s(SimpleGladeApp): +%(t)sdef __init__(self, glade_path="%(glade)s", root="%(root)s", domain=None): +%(t)s%(t)sglade_path = os.path.join(glade_dir, glade_path) +%(t)s%(t)sSimpleGladeApp.__init__(self, glade_path, root, domain) + +%(t)sdef new(self): +%(t)s%(t)s#context %(class)s.new { +%(t)s%(t)sprint "A new %(class)s has been created" +%(t)s%(t)s#context %(class)s.new } + +%(t)s#context %(class)s custom methods { +%(t)s#--- Write your own methods here ---# +%(t)s#context %(class)s custom methods } + +""" + +callback_format = """\ +%(t)sdef %(handler)s(self, widget, *args): +%(t)s%(t)s#context %(class)s.%(handler)s { +%(t)s%(t)sprint "%(handler)s called with self.%%s" %% widget.get_name() +%(t)s%(t)s#context %(class)s.%(handler)s } + +""" + +creation_format = """\ +%(t)sdef %(handler)s(self, str1, str2, int1, int2): +%(t)s%(t)s#context %(class)s.%(handler)s { +%(t)s%(t)swidget = gtk.Label("%(handler)s") +%(t)s%(t)swidget.show_all() +%(t)s%(t)sreturn widget +%(t)s%(t)s#context %(class)s.%(handler)s } + +""" + +main_format = """\ +def main(): +""" + +instance_format = """\ +%(t)s%(root)s = %(class)s() +""" +run_format = """\ + +%(t)s%(root)s.run() + +if __name__ == "__main__": +%(t)smain() +""" + +class NotGladeDocumentException(SAXParseException): + def __init__(self, glade_writer): + strerror = "Not a glade-2 document" + SAXParseException.__init__(self, strerror, None, glade_writer.sax_parser) + +class SimpleGladeCodeWriter(xml.sax.handler.ContentHandler): + def __init__(self, glade_file): + self.indent = "\t" + self.code = "" + self.roots_list = [] + self.widgets_stack = [] + self.creation_functions = [] + self.callbacks = [] + self.parent_is_creation_function = False + self.glade_file = glade_file + self.data = {} + self.input_dir, self.input_file = os.path.split(glade_file) + base = os.path.splitext(self.input_file)[0] + module = self.normalize_symbol(base) + self.output_file = os.path.join(self.input_dir, module) + ".py" + self.sax_parser = xml.sax.make_parser() + self.sax_parser.setFeature(xml.sax.handler.feature_external_ges, False) + self.sax_parser.setContentHandler(self) + self.data["glade"] = self.input_file + self.data["module"] = module + self.data["date"] = time.asctime() + + def normalize_symbol(self, base): + return "_".join( re.findall(tokenize.Name, base) ) + + def capitalize_symbol(self, base): + ClassName = "[a-zA-Z0-9]+" + base = self.normalize_symbol(base) + capitalize_map = lambda s : s[0].upper() + s[1:] + return "".join( map(capitalize_map, re.findall(ClassName, base)) ) + + def uncapitalize_symbol(self, base): + InstanceName = "([a-z])([A-Z])" + action = lambda m: "%s_%s" % ( m.groups()[0], m.groups()[1].lower() ) + base = self.normalize_symbol(base) + base = base[0].lower() + base[1:] + return re.sub(InstanceName, action, base) + + def startElement(self, name, attrs): + if name == "widget": + widget_id = attrs.get("id") + widget_class = attrs.get("class") + if not widget_id or not widget_class: + raise NotGladeDocumentException(self) + if not self.widgets_stack: + self.creation_functions = [] + self.callbacks = [] + class_name = self.capitalize_symbol(widget_id) + self.data["class"] = class_name + self.data["root"] = widget_id + self.roots_list.append(widget_id) + self.code += class_format % self.data + self.widgets_stack.append(widget_id) + elif name == "signal": + if not self.widgets_stack: + raise NotGladeDocumentException(self) + widget = self.widgets_stack[-1] + signal_object = attrs.get("object") + if signal_object: + return + handler = attrs.get("handler") + if not handler: + raise NotGladeDocumentException(self) + if handler.startswith("gtk_"): + return + signal = attrs.get("name") + if not signal: + raise NotGladeDocumentException(self) + self.data["widget"] = widget + self.data["signal"] = signal + self.data["handler"]= handler + if handler not in self.callbacks: + self.code += callback_format % self.data + self.callbacks.append(handler) + elif name == "property": + if not self.widgets_stack: + raise NotGladeDocumentException(self) + widget = self.widgets_stack[-1] + prop_name = attrs.get("name") + if not prop_name: + raise NotGladeDocumentException(self) + if prop_name == "creation_function": + self.parent_is_creation_function = True + + def characters(self, content): + if self.parent_is_creation_function: + if not self.widgets_stack: + raise NotGladeDocumentException(self) + handler = content.strip() + if handler not in self.creation_functions: + self.data["handler"] = handler + self.code += creation_format % self.data + self.creation_functions.append(handler) + + def endElement(self, name): + if name == "property": + self.parent_is_creation_function = False + elif name == "widget": + if not self.widgets_stack: + raise NotGladeDocumentException(self) + self.widgets_stack.pop() + + def write(self): + self.data["t"] = self.indent + self.code += header_format % self.data + try: + glade = open(self.glade_file, "r") + self.sax_parser.parse(glade) + except xml.sax._exceptions.SAXParseException, e: + sys.stderr.write("Error parsing document\n") + return None + except IOError, e: + sys.stderr.write("%s\n" % e.strerror) + return None + + self.code += main_format % self.data + + for root in self.roots_list: + self.data["class"] = self.capitalize_symbol(root) + self.data["root"] = self.uncapitalize_symbol(root) + self.code += instance_format % self.data + + self.data["root"] = self.uncapitalize_symbol(self.roots_list[0]) + self.code += run_format % self.data + + try: + self.output = codecs.open(self.output_file, "w", "utf-8") + self.output.write(self.code) + self.output.close() + except IOError, e: + sys.stderr.write("%s\n" % e.strerror) + return None + return self.output_file + +def usage(): + program = sys.argv[0] + print """\ +Write a simple python file from a glade file. +Usage: %s +""" % program + +def which(program): + if sys.platform.startswith("win"): + exe_ext = ".exe" + else: + exe_ext = "" + path_list = os.environ["PATH"].split(os.pathsep) + for path in path_list: + program_path = os.path.join(path, program) + exe_ext + if os.path.isfile(program_path): + return program_path + return None + +def check_for_programs(): + packages = {"diff" : "diffutils", "patch" : "patch"} + for package in packages.keys(): + if not which(package): + sys.stderr.write("Required program %s could not be found\n" % package) + sys.stderr.write("Is the package %s installed?\n" % packages[package]) + if sys.platform.startswith("win"): + sys.stderr.write("Download it from http://gnuwin32.sourceforge.net/packages.html\n") + sys.stderr.write("Also, be sure it is in the PATH\n") + return False + return True + +def main(): + if not check_for_programs(): + return -1 + if len(sys.argv) == 2: + code_writer = SimpleGladeCodeWriter( sys.argv[1] ) + glade_file = code_writer.glade_file + output_file = code_writer.output_file + output_file_orig = output_file + ".orig" + output_file_bak = output_file + ".bak" + short_f = os.path.split(output_file)[1] + short_f_orig = short_f + ".orig" + short_f_bak = short_f + ".bak" + helper_module = os.path.join(code_writer.input_dir,SimpleGladeApp_py) + custom_diff = "custom.diff" + + exists_output_file = os.path.exists(output_file) + exists_output_file_orig = os.path.exists(output_file_orig) + if not exists_output_file_orig and exists_output_file: + sys.stderr.write('File "%s" exists\n' % short_f) + sys.stderr.write('but "%s" does not.\n' % short_f_orig) + sys.stderr.write("That means your custom code would be overwritten.\n") + sys.stderr.write('Please manually remove "%s"\n' % short_f) + sys.stderr.write("from this directory.\n") + sys.stderr.write("Anyway, I\'ll create a backup for you in\n") + sys.stderr.write('"%s"\n' % short_f_bak) + shutil.copy(output_file, output_file_bak) + return -1 + if exists_output_file_orig and exists_output_file: + os.system("diff -U1 %s %s > %s" % (output_file_orig, output_file, custom_diff) ) + if not code_writer.write(): + os.remove(custom_diff) + return -1 + shutil.copy(output_file, output_file_orig) + if os.system("patch -fp0 < %s" % custom_diff): + os.remove(custom_diff) + return -1 + os.remove(custom_diff) + else: + if not code_writer.write(): + return -1 + shutil.copy(output_file, output_file_orig) + os.chmod(output_file, 0755) + if not os.path.isfile(helper_module): + open(helper_module, "w").write(SimpleGladeApp_content) + print "Wrote", output_file + return 0 + else: + usage() + return -1 + +SimpleGladeApp_py = "SimpleGladeApp.py" + +SimpleGladeApp_content = """\ +# SimpleGladeApp.py +# Module that provides an object oriented abstraction to pygtk and libglade. +# Copyright (C) 2004 Sandino Flores Moreno + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +try: + import os + import sys + import gtk + import gtk.glade +except ImportError: + print "Error importing pygtk2 and pygtk2-libglade" + sys.exit(1) + +class SimpleGladeApp(dict): + def __init__(self, glade_filename, main_widget_name=None, domain=None): + gtk.glade.set_custom_handler(self.custom_handler) + if os.path.isfile(glade_filename): + self.glade_path = glade_filename + else: + glade_dir = os.path.split( sys.argv[0] )[0] + self.glade_path = os.path.join(glade_dir, glade_filename) + self.glade = gtk.glade.XML(self.glade_path, main_widget_name, domain) + if main_widget_name: + self.main_widget = self.glade.get_widget(main_widget_name) + else: + self.main_widget = None + self.signal_autoconnect() + self.new() + + def signal_autoconnect(self): + signals = {} + for attr_name in dir(self): + attr = getattr(self, attr_name) + if callable(attr): + signals[attr_name] = attr + self.glade.signal_autoconnect(signals) + + def custom_handler(self, + glade, function_name, widget_name, + str1, str2, int1, int2): + if hasattr(self, function_name): + handler = getattr(self, function_name) + return handler(str1, str2, int1, int2) + + def __getattr__(self, data_name): + if data_name in self: + data = self[data_name] + return data + else: + widget = self.glade.get_widget(data_name) + if widget != None: + self[data_name] = widget + return widget + else: + raise AttributeError, data_name + + def __setattr__(self, name, value): + self[name] = value + + def new(self): + pass + + def on_keyboard_interrupt(self): + pass + + def gtk_widget_show(self, widget, *args): + widget.show() + + def gtk_widget_hide(self, widget, *args): + widget.hide() + + def gtk_widget_grab_focus(self, widget, *args): + widget.grab_focus() + + def gtk_widget_destroy(self, widget, *args): + widget.destroy() + + def gtk_window_activate_default(self, widget, *args): + widget.activate_default() + + def gtk_true(self, *args): + return gtk.TRUE + + def gtk_false(self, *args): + return gtk.FALSE + + def gtk_main_quit(self, *args): + gtk.main_quit() + + def main(self): + gtk.main() + + def quit(self): + gtk.main_quit() + + def run(self): + try: + self.main() + except KeyboardInterrupt: + self.on_keyboard_interrupt() +""" + +if __name__ == "__main__": + exit_code = main() + sys.exit(exit_code) diff --git a/GDM/OTHER-SoftBlueGlow_1024x768.png b/GDM/OTHER-SoftBlueGlow_1024x768.png new file mode 100644 index 0000000..a7e1170 Binary files /dev/null and b/GDM/OTHER-SoftBlueGlow_1024x768.png differ diff --git a/GDM/VIP.1/Background.png b/GDM/VIP.1/Background.png new file mode 100644 index 0000000..9eb1d2e Binary files /dev/null and b/GDM/VIP.1/Background.png differ diff --git a/GDM/VIP.1/Background2.png b/GDM/VIP.1/Background2.png new file mode 100644 index 0000000..a7e1170 Binary files /dev/null and b/GDM/VIP.1/Background2.png differ diff --git a/GDM/VIP.1/GdmGreeterTheme.desktop b/GDM/VIP.1/GdmGreeterTheme.desktop new file mode 100644 index 0000000..408534c --- /dev/null +++ b/GDM/VIP.1/GdmGreeterTheme.desktop @@ -0,0 +1,9 @@ +# This is not really a .desktop file like the rest, but it's useful to treat +# it as such + +[GdmGreeterTheme] +Greeter=VIP.xml +Name=VIP +Description=VIP Express Login +Author=Jim Infield +Screenshot= diff --git a/GDM/VIP.1/VIP.xml b/GDM/VIP.1/VIP.xml new file mode 100644 index 0000000..a673ae4 --- /dev/null +++ b/GDM/VIP.1/VIP.xml @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %h // + + + + + %c + + + + + + + + + + + + + + + You've got capslock on! + Teniu capslock activat! + Caps lock-tasten er slået til! + Tiene activado el bloqueo de mayúsculas. + Sul on caplock peal! + Sinulla on caps lock päällä! + Vous avez la touche Verr. Maj. activé ! + Caps Lock이 켜져 있습니다! + Jūsų Caps Lock yra įjungtas! + Anda mempunyai capslock dihidupkan! + Caps-lock staat aan! + Du har capslock på! + Włączony jest klawisz Caps Lock! + Tem o capslock ligado! + Máte zapnutý CAPS LOCK. + Vključene imate velike črke! + Du har CapsLock på! + Bạn đang bật CapsLock! + 請留意不要按下 capslock! + + + + + + + + + + + + + + + User %s will login in %d seconds + %s istifadəçisi %d saniyə içində sistemə girəcəkdir + L'usuari %s entrarà en %d segons + Uživatel %s bude přihlášen za %d vteřin + Brugeren %s logger på om %d sekunder + Benutzer %s wird in %d Sekunden angemeldet + El usuario %s accederá en %d segundos + Kasutaja %s logitakse sisse %d sekundi pärast + %s erabiltzaileak %d segundo barru hasiko du saioa + käyttäjä %s kirjautuu %d sekunnin kuluttua + L'utilisateur %s se connectera dans %d secondes + A/O usuaria/o %s conectará en %d segundos + %s felhasználó beléptetése %d másodperc múlva + L'utente %s effettuerà il login fra %d secondi + ユーザ%sは%d秒後にログイン + 사용자 %s는 %d 초 이내에 로그인 하여야 합니다 + Vartotojas %s bus prijungtas per %d sek. + Lietotājs %s ielogosies %d sekundēs + Pengguna %s akan logmasuk dalam %d saat + Gebruiker %s wordt aangemeld over %d seconden + Brukar %s vil logge inn om %d sekund + Bruker %s vil logge på om %d sekunder + Użytkownik %s zostanie zalogowany w ciągu %d sekund + Utilizador %s iniciará sessão em %d segundos + O usuário %s efetuará login em %d segundos + Utilizatorul %s va fi logat în %d secunde + Používateľ %s bude automaticky prihlásený za %d sekúnd + Uporabnik %s se bo prijavil v %d sekundah + Användaren %s kommer att logga in om %d sekunder + %s kullanıcısı %d saniye içinde giriş yapacak + Người dùng %s sẽ đăng nhập trong vòng %d giây + 用户 %s 将在 %d 秒后登录 + 使用者 %s 將會在 %d 內登入 + + + + + + + + + + + + + + + + + + + + diff --git a/GDM/VIP.1/icon-language-active.png b/GDM/VIP.1/icon-language-active.png new file mode 100644 index 0000000..c8b64b6 Binary files /dev/null and b/GDM/VIP.1/icon-language-active.png differ diff --git a/GDM/VIP.1/icon-language-prelight.png b/GDM/VIP.1/icon-language-prelight.png new file mode 100644 index 0000000..56e2b56 Binary files /dev/null and b/GDM/VIP.1/icon-language-prelight.png differ diff --git a/GDM/VIP.1/icon-language.png b/GDM/VIP.1/icon-language.png new file mode 100644 index 0000000..573b42f Binary files /dev/null and b/GDM/VIP.1/icon-language.png differ diff --git a/GDM/VIP.1/icon-reboot-active.png b/GDM/VIP.1/icon-reboot-active.png new file mode 100644 index 0000000..0860260 Binary files /dev/null and b/GDM/VIP.1/icon-reboot-active.png differ diff --git a/GDM/VIP.1/icon-reboot-prelight.png b/GDM/VIP.1/icon-reboot-prelight.png new file mode 100644 index 0000000..e6650ba Binary files /dev/null and b/GDM/VIP.1/icon-reboot-prelight.png differ diff --git a/GDM/VIP.1/icon-reboot.png b/GDM/VIP.1/icon-reboot.png new file mode 100644 index 0000000..a3d4b4e Binary files /dev/null and b/GDM/VIP.1/icon-reboot.png differ diff --git a/GDM/VIP.1/icon-session-active.png b/GDM/VIP.1/icon-session-active.png new file mode 100644 index 0000000..f3d45fd Binary files /dev/null and b/GDM/VIP.1/icon-session-active.png differ diff --git a/GDM/VIP.1/icon-session-prelight.png b/GDM/VIP.1/icon-session-prelight.png new file mode 100644 index 0000000..a97d7ef Binary files /dev/null and b/GDM/VIP.1/icon-session-prelight.png differ diff --git a/GDM/VIP.1/icon-session.png b/GDM/VIP.1/icon-session.png new file mode 100644 index 0000000..9b428a1 Binary files /dev/null and b/GDM/VIP.1/icon-session.png differ diff --git a/GDM/VIP.1/icon-shutdown-active.png b/GDM/VIP.1/icon-shutdown-active.png new file mode 100644 index 0000000..ba16ac1 Binary files /dev/null and b/GDM/VIP.1/icon-shutdown-active.png differ diff --git a/GDM/VIP.1/icon-shutdown-prelight.png b/GDM/VIP.1/icon-shutdown-prelight.png new file mode 100644 index 0000000..c9d0888 Binary files /dev/null and b/GDM/VIP.1/icon-shutdown-prelight.png differ diff --git a/GDM/VIP.1/icon-shutdown.png b/GDM/VIP.1/icon-shutdown.png new file mode 100644 index 0000000..968305c Binary files /dev/null and b/GDM/VIP.1/icon-shutdown.png differ diff --git a/GDM/VIP/Background.jpg b/GDM/VIP/Background.jpg new file mode 100644 index 0000000..253ca9a Binary files /dev/null and b/GDM/VIP/Background.jpg differ diff --git a/GDM/VIP/Background.png b/GDM/VIP/Background.png new file mode 100644 index 0000000..a7e1170 Binary files /dev/null and b/GDM/VIP/Background.png differ diff --git a/GDM/VIP/GdmGreeterTheme.desktop b/GDM/VIP/GdmGreeterTheme.desktop new file mode 100644 index 0000000..408534c --- /dev/null +++ b/GDM/VIP/GdmGreeterTheme.desktop @@ -0,0 +1,9 @@ +# This is not really a .desktop file like the rest, but it's useful to treat +# it as such + +[GdmGreeterTheme] +Greeter=VIP.xml +Name=VIP +Description=VIP Express Login +Author=Jim Infield +Screenshot= diff --git a/GDM/VIP/VIP.xml b/GDM/VIP/VIP.xml new file mode 100644 index 0000000..a673ae4 --- /dev/null +++ b/GDM/VIP/VIP.xml @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %h // + + + + + %c + + + + + + + + + + + + + + + You've got capslock on! + Teniu capslock activat! + Caps lock-tasten er slået til! + Tiene activado el bloqueo de mayúsculas. + Sul on caplock peal! + Sinulla on caps lock päällä! + Vous avez la touche Verr. Maj. activé ! + Caps Lock이 켜져 있습니다! + Jūsų Caps Lock yra įjungtas! + Anda mempunyai capslock dihidupkan! + Caps-lock staat aan! + Du har capslock på! + Włączony jest klawisz Caps Lock! + Tem o capslock ligado! + Máte zapnutý CAPS LOCK. + Vključene imate velike črke! + Du har CapsLock på! + Bạn đang bật CapsLock! + 請留意不要按下 capslock! + + + + + + + + + + + + + + + User %s will login in %d seconds + %s istifadəçisi %d saniyə içində sistemə girəcəkdir + L'usuari %s entrarà en %d segons + Uživatel %s bude přihlášen za %d vteřin + Brugeren %s logger på om %d sekunder + Benutzer %s wird in %d Sekunden angemeldet + El usuario %s accederá en %d segundos + Kasutaja %s logitakse sisse %d sekundi pärast + %s erabiltzaileak %d segundo barru hasiko du saioa + käyttäjä %s kirjautuu %d sekunnin kuluttua + L'utilisateur %s se connectera dans %d secondes + A/O usuaria/o %s conectará en %d segundos + %s felhasználó beléptetése %d másodperc múlva + L'utente %s effettuerà il login fra %d secondi + ユーザ%sは%d秒後にログイン + 사용자 %s는 %d 초 이내에 로그인 하여야 합니다 + Vartotojas %s bus prijungtas per %d sek. + Lietotājs %s ielogosies %d sekundēs + Pengguna %s akan logmasuk dalam %d saat + Gebruiker %s wordt aangemeld over %d seconden + Brukar %s vil logge inn om %d sekund + Bruker %s vil logge på om %d sekunder + Użytkownik %s zostanie zalogowany w ciągu %d sekund + Utilizador %s iniciará sessão em %d segundos + O usuário %s efetuará login em %d segundos + Utilizatorul %s va fi logat în %d secunde + Používateľ %s bude automaticky prihlásený za %d sekúnd + Uporabnik %s se bo prijavil v %d sekundah + Användaren %s kommer att logga in om %d sekunder + %s kullanıcısı %d saniye içinde giriş yapacak + Người dùng %s sẽ đăng nhập trong vòng %d giây + 用户 %s 将在 %d 秒后登录 + 使用者 %s 將會在 %d 內登入 + + + + + + + + + + + + + + + + + + + + diff --git a/GDM/VIP/VIP.xml~ b/GDM/VIP/VIP.xml~ new file mode 100644 index 0000000..7340448 --- /dev/null +++ b/GDM/VIP/VIP.xml~ @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %h // + + + + + %c + + + + + + + + + + + + + + + You've got capslock on! + Teniu capslock activat! + Caps lock-tasten er slået til! + Tiene activado el bloqueo de mayúsculas. + Sul on caplock peal! + Sinulla on caps lock päällä! + Vous avez la touche Verr. Maj. activé ! + Caps Lock이 켜져 있습니다! + Jūsų Caps Lock yra įjungtas! + Anda mempunyai capslock dihidupkan! + Caps-lock staat aan! + Du har capslock på! + Włączony jest klawisz Caps Lock! + Tem o capslock ligado! + Máte zapnutý CAPS LOCK. + Vključene imate velike črke! + Du har CapsLock på! + Bạn đang bật CapsLock! + 請留意不要按下 capslock! + + + + + + + + + + + + + + + User %s will login in %d seconds + %s istifadəçisi %d saniyə içində sistemə girəcəkdir + L'usuari %s entrarà en %d segons + Uživatel %s bude přihlášen za %d vteřin + Brugeren %s logger på om %d sekunder + Benutzer %s wird in %d Sekunden angemeldet + El usuario %s accederá en %d segundos + Kasutaja %s logitakse sisse %d sekundi pärast + %s erabiltzaileak %d segundo barru hasiko du saioa + käyttäjä %s kirjautuu %d sekunnin kuluttua + L'utilisateur %s se connectera dans %d secondes + A/O usuaria/o %s conectará en %d segundos + %s felhasználó beléptetése %d másodperc múlva + L'utente %s effettuerà il login fra %d secondi + ユーザ%sは%d秒後にログイン + 사용자 %s는 %d 초 이내에 로그인 하여야 합니다 + Vartotojas %s bus prijungtas per %d sek. + Lietotājs %s ielogosies %d sekundēs + Pengguna %s akan logmasuk dalam %d saat + Gebruiker %s wordt aangemeld over %d seconden + Brukar %s vil logge inn om %d sekund + Bruker %s vil logge på om %d sekunder + Użytkownik %s zostanie zalogowany w ciągu %d sekund + Utilizador %s iniciará sessão em %d segundos + O usuário %s efetuará login em %d segundos + Utilizatorul %s va fi logat în %d secunde + Používateľ %s bude automaticky prihlásený za %d sekúnd + Uporabnik %s se bo prijavil v %d sekundah + Användaren %s kommer att logga in om %d sekunder + %s kullanıcısı %d saniye içinde giriş yapacak + Người dùng %s sẽ đăng nhập trong vòng %d giây + 用户 %s 将在 %d 秒后登录 + 使用者 %s 將會在 %d 內登入 + + + + + + + + + + + + + + + + + + + + diff --git a/GDM/VIP/icon-language-active.png b/GDM/VIP/icon-language-active.png new file mode 100644 index 0000000..c8b64b6 Binary files /dev/null and b/GDM/VIP/icon-language-active.png differ diff --git a/GDM/VIP/icon-language-prelight.png b/GDM/VIP/icon-language-prelight.png new file mode 100644 index 0000000..56e2b56 Binary files /dev/null and b/GDM/VIP/icon-language-prelight.png differ diff --git a/GDM/VIP/icon-language.png b/GDM/VIP/icon-language.png new file mode 100644 index 0000000..573b42f Binary files /dev/null and b/GDM/VIP/icon-language.png differ diff --git a/GDM/VIP/icon-reboot-active.png b/GDM/VIP/icon-reboot-active.png new file mode 100644 index 0000000..0860260 Binary files /dev/null and b/GDM/VIP/icon-reboot-active.png differ diff --git a/GDM/VIP/icon-reboot-prelight.png b/GDM/VIP/icon-reboot-prelight.png new file mode 100644 index 0000000..e6650ba Binary files /dev/null and b/GDM/VIP/icon-reboot-prelight.png differ diff --git a/GDM/VIP/icon-reboot.png b/GDM/VIP/icon-reboot.png new file mode 100644 index 0000000..a3d4b4e Binary files /dev/null and b/GDM/VIP/icon-reboot.png differ diff --git a/GDM/VIP/icon-session-active.png b/GDM/VIP/icon-session-active.png new file mode 100644 index 0000000..f3d45fd Binary files /dev/null and b/GDM/VIP/icon-session-active.png differ diff --git a/GDM/VIP/icon-session-prelight.png b/GDM/VIP/icon-session-prelight.png new file mode 100644 index 0000000..a97d7ef Binary files /dev/null and b/GDM/VIP/icon-session-prelight.png differ diff --git a/GDM/VIP/icon-session.png b/GDM/VIP/icon-session.png new file mode 100644 index 0000000..9b428a1 Binary files /dev/null and b/GDM/VIP/icon-session.png differ diff --git a/GDM/VIP/icon-shutdown-active.png b/GDM/VIP/icon-shutdown-active.png new file mode 100644 index 0000000..ba16ac1 Binary files /dev/null and b/GDM/VIP/icon-shutdown-active.png differ diff --git a/GDM/VIP/icon-shutdown-prelight.png b/GDM/VIP/icon-shutdown-prelight.png new file mode 100644 index 0000000..c9d0888 Binary files /dev/null and b/GDM/VIP/icon-shutdown-prelight.png differ diff --git a/GDM/VIP/icon-shutdown.png b/GDM/VIP/icon-shutdown.png new file mode 100644 index 0000000..968305c Binary files /dev/null and b/GDM/VIP/icon-shutdown.png differ diff --git a/GDM/p9200128.jpg b/GDM/p9200128.jpg new file mode 100644 index 0000000..7e22c71 Binary files /dev/null and b/GDM/p9200128.jpg differ diff --git a/GDM/p9200129.jpg b/GDM/p9200129.jpg new file mode 100644 index 0000000..087a2ab Binary files /dev/null and b/GDM/p9200129.jpg differ diff --git a/GDM/p9200130.jpg b/GDM/p9200130.jpg new file mode 100644 index 0000000..ebdd236 Binary files /dev/null and b/GDM/p9200130.jpg differ diff --git a/GDM/p9200131.jpg b/GDM/p9200131.jpg new file mode 100644 index 0000000..b4fb99d Binary files /dev/null and b/GDM/p9200131.jpg differ diff --git a/GDM/p9200132.jpg b/GDM/p9200132.jpg new file mode 100644 index 0000000..23dd4b8 Binary files /dev/null and b/GDM/p9200132.jpg differ diff --git a/GDM/test1/GdmGreeterTheme.desktop b/GDM/test1/GdmGreeterTheme.desktop new file mode 100644 index 0000000..4df3e32 --- /dev/null +++ b/GDM/test1/GdmGreeterTheme.desktop @@ -0,0 +1,9 @@ +# This is not really a .desktop file like the rest, but it's useful to treat +# it as such + +[GdmGreeterTheme] +Greeter=puesta_de_sol.xml +Name=puesta_de_sol +Description=La puesta de sol en la bahia de Almería (España). +Author=Pexi (jfestrada@gmail.com) +Screenshot=captura.png diff --git a/GDM/test1/background.jpg b/GDM/test1/background.jpg new file mode 100644 index 0000000..63d37aa Binary files /dev/null and b/GDM/test1/background.jpg differ diff --git a/GDM/test1/captura.png b/GDM/test1/captura.png new file mode 100644 index 0000000..8f0b35d Binary files /dev/null and b/GDM/test1/captura.png differ diff --git a/GDM/test1/puesta_de_sol.png b/GDM/test1/puesta_de_sol.png new file mode 100644 index 0000000..bd1630a Binary files /dev/null and b/GDM/test1/puesta_de_sol.png differ diff --git a/GDM/test1/puesta_de_sol.xml b/GDM/test1/puesta_de_sol.xml new file mode 100644 index 0000000..244469f --- /dev/null +++ b/GDM/test1/puesta_de_sol.xml @@ -0,0 +1,372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Language + Opció + Možnosti + Indstillinger + Opción + Valikud + Valinta + Option + 옵션 + Parinktis + Opsyen + Optie + Alternativ + Opcja + Opção + Možnosť + Možnost + Alternativ + Tùy chọn + 選項 + + + + + + + + + + + + + Session + Iclas + Sessió + Sezení + Session + Sitzung + Συνεδρία + Sesión + Sessioon + Saioa + Istunto + Session + Seisiún + Sesión + Munkafolyamat + Sessione + セッション + 세션 + Sesija + Sesija + Sesi + Sessie + Økt + Sesjon + Typ sesji + Sessão + Sessões + Sesiune + Сеанс + Sedenie + Seja + Session + «Á÷× + Oturum + Сеанс + Session + 会话 + 作業階段 + + + + + + + + + + + + + + System + Sistem + Sistema + Systém + System + System + Σύστημα + Sistema + Süsteem + Sistema + Järjestelmä + Système + Corás + Sistema + Rendszer + Sistema + システム + 시스템 + Sistema + Sistēma + Sistem + Systeem + System + System + Systemowe + Sistema + Sistema + Sistem + Система + Systém + Sistem + System + «¨ÁôÒ + Sistem + Система + Hệ thống + 系统 + 系統 + + + + + + + + + + + + + + Disconnect + Bağlantını kəs + Desconnecta + Odpojit se + Frakobl + Desconectar + Lahuta ühendus + Deskonektatu + Katkaise yhteys + Déconnecter + Desconectar + Disconnetti + 接続切断 + 연결 해제 + Atsijungti + Atslēgties + Putus + Verbreek verbinding + Kople frå + Koble fra + Rozłącz + Desligar + Desconectar + Deconectează + Отключиться + Odpojiť + Odklopi se + Koppla från + Від'єднатись + Ngắt kết nối + 断开连接 + 中斷連線 + + + + + + + + Quit + Çıx + Surt + Konec + Afslut + Beenden + Salir + Lõpeta + Irten + Lopeta + Quitter + Saír + Kilépés + Esci + 終了 + 끝내기 + Išeiti + Iziet + Keluar + Afsluiten + Avslutt + Avslutt + Zakończ + Sair + Sair + Renunţă + Выйти + Koniec + Izhod + Avsluta + Çık + Вийти + Thoát + 退出 + 離開 + + + + + + + + + + %c + + + + + + + + + + + + You've got capslock on! + Teniu capslock activat! + Caps lock-tasten er slået til! + Tiene activado el bloqueo de mayúsculas. + Sul on caplock peal! + Sinulla on caps lock päällä! + Vous avez la touche Verr. Maj. activé ! + Caps Lock이 켜져 있습니다! + Jūsų Caps Lock yra įjungtas! + Anda mempunyai capslock dihidupkan! + Caps-lock staat aan! + Du har capslock på! + Włączony jest klawisz Caps Lock! + Tem o capslock ligado! + Máte zapnutý CAPS LOCK. + Vključene imate velike črke! + Du har CapsLock på! + Bạn đang bật CapsLock! + 請留意不要按下 capslock! + + + + + + + + + + + + User %s will login in %d seconds + %s istifadəçisi %d saniyə içində sistemə girəcəkdir + L'usuari %s entrarà en %d segons + Uživatel %s bude přihlášen za %d vteřin + Brugeren %s logger på om %d sekunder + Benutzer %s wird in %d Sekunden angemeldet + El usuario %s accederá en %d segundos + Kasutaja %s logitakse sisse %d sekundi pärast + %s erabiltzaileak %d segundo barru hasiko du saioa + käyttäjä %s kirjautuu %d sekunnin kuluttua + L'utilisateur %s se connectera dans %d secondes + A/O usuaria/o %s conectará en %d segundos + %s felhasználó beléptetése %d másodperc múlva + L'utente %s effettuerà il login fra %d secondi + ユーザ%sは%d秒後にログイン + 사용자 %s는 %d 초 이내에 로그인 하여야 합니다 + Vartotojas %s bus prijungtas per %d sek. + Lietotājs %s ielogosies %d sekundēs + Pengguna %s akan logmasuk dalam %d saat + Gebruiker %s wordt aangemeld over %d seconden + Brukar %s vil logge inn om %d sekund + Bruker %s vil logge på om %d sekunder + Użytkownik %s zostanie zalogowany w ciągu %d sekund + Utilizador %s iniciará sessão em %d segundos + O usuário %s efetuará login em %d segundos + Utilizatorul %s va fi logat în %d secunde + Používateľ %s bude automaticky prihlásený za %d sekúnd + Uporabnik %s se bo prijavil v %d sekundah + Användaren %s kommer att logga in om %d sekunder + %s kullanıcısı %d saniye içinde giriş yapacak + Người dùng %s sẽ đăng nhập trong vòng %d giây + 用户 %s 将在 %d 秒后登录 + 使用者 %s 將會在 %d 內登入 + + + + + + + + + + + Welcome at %h + Benvingut a %h + Vítejte na %h + Velkommen til %h + Bienvenido a %h + Tere tulemast masinasse %h + %h - tervetuloa. + Bienvenue sur %h + %n에 오신 것을 환영합니다 + Sveiki atvykę į %h + Selamat Datang ke %h + Welkom bij %h + Velkommen til %h + Witaj w systemie %h + Bem Vindo ao %h + Víta vás %h + Dobrodošli na %h + Välkommen till %h + Chào mừng tới %h + 歡迎來到 %h + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Scan/SimpleGladeApp.py b/Scan/SimpleGladeApp.py new file mode 100644 index 0000000..9e66196 --- /dev/null +++ b/Scan/SimpleGladeApp.py @@ -0,0 +1,115 @@ +# SimpleGladeApp.py +# Module that provides an object oriented abstraction to pygtk and libglade. +# Copyright (C) 2004 Sandino Flores Moreno + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +try: + import os + import sys + import gtk + import gtk.glade +except ImportError: + print "Error importing pygtk2 and pygtk2-libglade" + sys.exit(1) + +class SimpleGladeApp(dict): + def __init__(self, glade_filename, main_widget_name=None, domain=None): + gtk.glade.set_custom_handler(self.custom_handler) + if os.path.isfile(glade_filename): + self.glade_path = glade_filename + else: + glade_dir = os.path.split( sys.argv[0] )[0] + self.glade_path = os.path.join(glade_dir, glade_filename) + self.glade = gtk.glade.XML(self.glade_path, main_widget_name, domain) + if main_widget_name: + self.main_widget = self.glade.get_widget(main_widget_name) + else: + self.main_widget = None + self.signal_autoconnect() + self.new() + + def signal_autoconnect(self): + signals = {} + for attr_name in dir(self): + attr = getattr(self, attr_name) + if callable(attr): + signals[attr_name] = attr + self.glade.signal_autoconnect(signals) + + def custom_handler(self, + glade, function_name, widget_name, + str1, str2, int1, int2): + if hasattr(self, function_name): + handler = getattr(self, function_name) + return handler(str1, str2, int1, int2) + + def __getattr__(self, data_name): + if data_name in self: + data = self[data_name] + return data + else: + widget = self.glade.get_widget(data_name) + if widget != None: + self[data_name] = widget + return widget + else: + raise AttributeError, data_name + + def __setattr__(self, name, value): + self[name] = value + + def new(self): + pass + + def on_keyboard_interrupt(self): + pass + + def gtk_widget_show(self, widget, *args): + widget.show() + + def gtk_widget_hide(self, widget, *args): + widget.hide() + + def gtk_widget_grab_focus(self, widget, *args): + widget.grab_focus() + + def gtk_widget_destroy(self, widget, *args): + widget.destroy() + + def gtk_window_activate_default(self, widget, *args): + widget.activate_default() + + def gtk_true(self, *args): + return gtk.TRUE + + def gtk_false(self, *args): + return gtk.FALSE + + def gtk_main_quit(self, *args): + gtk.main_quit() + + def main(self): + gtk.main() + + def quit(self): + gtk.main_quit() + + def run(self): + try: + self.main() + except KeyboardInterrupt: + self.on_keyboard_interrupt() diff --git a/Scan/SimpleGladeApp.pyc b/Scan/SimpleGladeApp.pyc new file mode 100644 index 0000000..88209ee Binary files /dev/null and b/Scan/SimpleGladeApp.pyc differ diff --git a/Scan/simple-glade-codegen.py b/Scan/simple-glade-codegen.py new file mode 100755 index 0000000..143da7e --- /dev/null +++ b/Scan/simple-glade-codegen.py @@ -0,0 +1,442 @@ +#!/usr/bin/env python + +# simple-glade-codegen.py +# A code generator that uses pygtk, glade and SimpleGladeApp.py +# Copyright (C) 2004 Sandino Flores Moreno + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +import sys, os, re, codecs +import tokenize, shutil, time +import xml.sax +from xml.sax._exceptions import SAXParseException + +header_format = """\ +#!/usr/bin/env python +# -*- coding: UTF8 -*- + +# Python module %(module)s.py +# Autogenerated from %(glade)s +# Generated on %(date)s + +# Warning: Do not delete or modify comments related to context +# They are required to keep user's code + +import os, gtk +from SimpleGladeApp import SimpleGladeApp + +glade_dir = "" + +# Put your modules and data here + +# From here through main() codegen inserts/updates a class for +# every top-level widget in the .glade file. + +""" + +class_format = """\ +class %(class)s(SimpleGladeApp): +%(t)sdef __init__(self, glade_path="%(glade)s", root="%(root)s", domain=None): +%(t)s%(t)sglade_path = os.path.join(glade_dir, glade_path) +%(t)s%(t)sSimpleGladeApp.__init__(self, glade_path, root, domain) + +%(t)sdef new(self): +%(t)s%(t)s#context %(class)s.new { +%(t)s%(t)sprint "A new %(class)s has been created" +%(t)s%(t)s#context %(class)s.new } + +%(t)s#context %(class)s custom methods { +%(t)s#--- Write your own methods here ---# +%(t)s#context %(class)s custom methods } + +""" + +callback_format = """\ +%(t)sdef %(handler)s(self, widget, *args): +%(t)s%(t)s#context %(class)s.%(handler)s { +%(t)s%(t)sprint "%(handler)s called with self.%%s" %% widget.get_name() +%(t)s%(t)s#context %(class)s.%(handler)s } + +""" + +creation_format = """\ +%(t)sdef %(handler)s(self, str1, str2, int1, int2): +%(t)s%(t)s#context %(class)s.%(handler)s { +%(t)s%(t)swidget = gtk.Label("%(handler)s") +%(t)s%(t)swidget.show_all() +%(t)s%(t)sreturn widget +%(t)s%(t)s#context %(class)s.%(handler)s } + +""" + +main_format = """\ +def main(): +""" + +instance_format = """\ +%(t)s%(root)s = %(class)s() +""" +run_format = """\ + +%(t)s%(root)s.run() + +if __name__ == "__main__": +%(t)smain() +""" + +class NotGladeDocumentException(SAXParseException): + def __init__(self, glade_writer): + strerror = "Not a glade-2 document" + SAXParseException.__init__(self, strerror, None, glade_writer.sax_parser) + +class SimpleGladeCodeWriter(xml.sax.handler.ContentHandler): + def __init__(self, glade_file): + self.indent = "\t" + self.code = "" + self.roots_list = [] + self.widgets_stack = [] + self.creation_functions = [] + self.callbacks = [] + self.parent_is_creation_function = False + self.glade_file = glade_file + self.data = {} + self.input_dir, self.input_file = os.path.split(glade_file) + base = os.path.splitext(self.input_file)[0] + module = self.normalize_symbol(base) + self.output_file = os.path.join(self.input_dir, module) + ".py" + self.sax_parser = xml.sax.make_parser() + self.sax_parser.setFeature(xml.sax.handler.feature_external_ges, False) + self.sax_parser.setContentHandler(self) + self.data["glade"] = self.input_file + self.data["module"] = module + self.data["date"] = time.asctime() + + def normalize_symbol(self, base): + return "_".join( re.findall(tokenize.Name, base) ) + + def capitalize_symbol(self, base): + ClassName = "[a-zA-Z0-9]+" + base = self.normalize_symbol(base) + capitalize_map = lambda s : s[0].upper() + s[1:] + return "".join( map(capitalize_map, re.findall(ClassName, base)) ) + + def uncapitalize_symbol(self, base): + InstanceName = "([a-z])([A-Z])" + action = lambda m: "%s_%s" % ( m.groups()[0], m.groups()[1].lower() ) + base = self.normalize_symbol(base) + base = base[0].lower() + base[1:] + return re.sub(InstanceName, action, base) + + def startElement(self, name, attrs): + if name == "widget": + widget_id = attrs.get("id") + widget_class = attrs.get("class") + if not widget_id or not widget_class: + raise NotGladeDocumentException(self) + if not self.widgets_stack: + self.creation_functions = [] + self.callbacks = [] + class_name = self.capitalize_symbol(widget_id) + self.data["class"] = class_name + self.data["root"] = widget_id + self.roots_list.append(widget_id) + self.code += class_format % self.data + self.widgets_stack.append(widget_id) + elif name == "signal": + if not self.widgets_stack: + raise NotGladeDocumentException(self) + widget = self.widgets_stack[-1] + signal_object = attrs.get("object") + if signal_object: + return + handler = attrs.get("handler") + if not handler: + raise NotGladeDocumentException(self) + if handler.startswith("gtk_"): + return + signal = attrs.get("name") + if not signal: + raise NotGladeDocumentException(self) + self.data["widget"] = widget + self.data["signal"] = signal + self.data["handler"]= handler + if handler not in self.callbacks: + self.code += callback_format % self.data + self.callbacks.append(handler) + elif name == "property": + if not self.widgets_stack: + raise NotGladeDocumentException(self) + widget = self.widgets_stack[-1] + prop_name = attrs.get("name") + if not prop_name: + raise NotGladeDocumentException(self) + if prop_name == "creation_function": + self.parent_is_creation_function = True + + def characters(self, content): + if self.parent_is_creation_function: + if not self.widgets_stack: + raise NotGladeDocumentException(self) + handler = content.strip() + if handler not in self.creation_functions: + self.data["handler"] = handler + self.code += creation_format % self.data + self.creation_functions.append(handler) + + def endElement(self, name): + if name == "property": + self.parent_is_creation_function = False + elif name == "widget": + if not self.widgets_stack: + raise NotGladeDocumentException(self) + self.widgets_stack.pop() + + def write(self): + self.data["t"] = self.indent + self.code += header_format % self.data + try: + glade = open(self.glade_file, "r") + self.sax_parser.parse(glade) + except xml.sax._exceptions.SAXParseException, e: + sys.stderr.write("Error parsing document\n") + return None + except IOError, e: + sys.stderr.write("%s\n" % e.strerror) + return None + + self.code += main_format % self.data + + for root in self.roots_list: + self.data["class"] = self.capitalize_symbol(root) + self.data["root"] = self.uncapitalize_symbol(root) + self.code += instance_format % self.data + + self.data["root"] = self.uncapitalize_symbol(self.roots_list[0]) + self.code += run_format % self.data + + try: + self.output = codecs.open(self.output_file, "w", "utf-8") + self.output.write(self.code) + self.output.close() + except IOError, e: + sys.stderr.write("%s\n" % e.strerror) + return None + return self.output_file + +def usage(): + program = sys.argv[0] + print """\ +Write a simple python file from a glade file. +Usage: %s +""" % program + +def which(program): + if sys.platform.startswith("win"): + exe_ext = ".exe" + else: + exe_ext = "" + path_list = os.environ["PATH"].split(os.pathsep) + for path in path_list: + program_path = os.path.join(path, program) + exe_ext + if os.path.isfile(program_path): + return program_path + return None + +def check_for_programs(): + packages = {"diff" : "diffutils", "patch" : "patch"} + for package in packages.keys(): + if not which(package): + sys.stderr.write("Required program %s could not be found\n" % package) + sys.stderr.write("Is the package %s installed?\n" % packages[package]) + if sys.platform.startswith("win"): + sys.stderr.write("Download it from http://gnuwin32.sourceforge.net/packages.html\n") + sys.stderr.write("Also, be sure it is in the PATH\n") + return False + return True + +def main(): + if not check_for_programs(): + return -1 + if len(sys.argv) == 2: + code_writer = SimpleGladeCodeWriter( sys.argv[1] ) + glade_file = code_writer.glade_file + output_file = code_writer.output_file + output_file_orig = output_file + ".orig" + output_file_bak = output_file + ".bak" + short_f = os.path.split(output_file)[1] + short_f_orig = short_f + ".orig" + short_f_bak = short_f + ".bak" + helper_module = os.path.join(code_writer.input_dir,SimpleGladeApp_py) + custom_diff = "custom.diff" + + exists_output_file = os.path.exists(output_file) + exists_output_file_orig = os.path.exists(output_file_orig) + if not exists_output_file_orig and exists_output_file: + sys.stderr.write('File "%s" exists\n' % short_f) + sys.stderr.write('but "%s" does not.\n' % short_f_orig) + sys.stderr.write("That means your custom code would be overwritten.\n") + sys.stderr.write('Please manually remove "%s"\n' % short_f) + sys.stderr.write("from this directory.\n") + sys.stderr.write("Anyway, I\'ll create a backup for you in\n") + sys.stderr.write('"%s"\n' % short_f_bak) + shutil.copy(output_file, output_file_bak) + return -1 + if exists_output_file_orig and exists_output_file: + os.system("diff -U1 %s %s > %s" % (output_file_orig, output_file, custom_diff) ) + if not code_writer.write(): + os.remove(custom_diff) + return -1 + shutil.copy(output_file, output_file_orig) + if os.system("patch -fp0 < %s" % custom_diff): + os.remove(custom_diff) + return -1 + os.remove(custom_diff) + else: + if not code_writer.write(): + return -1 + shutil.copy(output_file, output_file_orig) + os.chmod(output_file, 0755) + if not os.path.isfile(helper_module): + open(helper_module, "w").write(SimpleGladeApp_content) + print "Wrote", output_file + return 0 + else: + usage() + return -1 + +SimpleGladeApp_py = "SimpleGladeApp.py" + +SimpleGladeApp_content = """\ +# SimpleGladeApp.py +# Module that provides an object oriented abstraction to pygtk and libglade. +# Copyright (C) 2004 Sandino Flores Moreno + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +try: + import os + import sys + import gtk + import gtk.glade +except ImportError: + print "Error importing pygtk2 and pygtk2-libglade" + sys.exit(1) + +class SimpleGladeApp(dict): + def __init__(self, glade_filename, main_widget_name=None, domain=None): + gtk.glade.set_custom_handler(self.custom_handler) + if os.path.isfile(glade_filename): + self.glade_path = glade_filename + else: + glade_dir = os.path.split( sys.argv[0] )[0] + self.glade_path = os.path.join(glade_dir, glade_filename) + self.glade = gtk.glade.XML(self.glade_path, main_widget_name, domain) + if main_widget_name: + self.main_widget = self.glade.get_widget(main_widget_name) + else: + self.main_widget = None + self.signal_autoconnect() + self.new() + + def signal_autoconnect(self): + signals = {} + for attr_name in dir(self): + attr = getattr(self, attr_name) + if callable(attr): + signals[attr_name] = attr + self.glade.signal_autoconnect(signals) + + def custom_handler(self, + glade, function_name, widget_name, + str1, str2, int1, int2): + if hasattr(self, function_name): + handler = getattr(self, function_name) + return handler(str1, str2, int1, int2) + + def __getattr__(self, data_name): + if data_name in self: + data = self[data_name] + return data + else: + widget = self.glade.get_widget(data_name) + if widget != None: + self[data_name] = widget + return widget + else: + raise AttributeError, data_name + + def __setattr__(self, name, value): + self[name] = value + + def new(self): + pass + + def on_keyboard_interrupt(self): + pass + + def gtk_widget_show(self, widget, *args): + widget.show() + + def gtk_widget_hide(self, widget, *args): + widget.hide() + + def gtk_widget_grab_focus(self, widget, *args): + widget.grab_focus() + + def gtk_widget_destroy(self, widget, *args): + widget.destroy() + + def gtk_window_activate_default(self, widget, *args): + widget.activate_default() + + def gtk_true(self, *args): + return gtk.TRUE + + def gtk_false(self, *args): + return gtk.FALSE + + def gtk_main_quit(self, *args): + gtk.main_quit() + + def main(self): + gtk.main() + + def quit(self): + gtk.main_quit() + + def run(self): + try: + self.main() + except KeyboardInterrupt: + self.on_keyboard_interrupt() +""" + +if __name__ == "__main__": + exit_code = main() + sys.exit(exit_code) diff --git a/logo/logo.gif b/logo/logo.gif new file mode 100644 index 0000000..e1fa1e9 Binary files /dev/null and b/logo/logo.gif differ diff --git a/logo/logo.png b/logo/logo.png new file mode 100644 index 0000000..23a60b2 Binary files /dev/null and b/logo/logo.png differ diff --git a/logo/logo_bg.jpg b/logo/logo_bg.jpg new file mode 100644 index 0000000..371badd Binary files /dev/null and b/logo/logo_bg.jpg differ