Exemplo n.º 1
0
def main(args):
    bindtextdomain('gimmie', gimmie_globals.localedir)
    textdomain('gimmie')

    ### Uncomment to spew leak debug info
    #gc.set_debug(gc.DEBUG_LEAK)

    # Tell gobject/gtk we are threaded
    gtk.gdk.threads_init()

    gnome.program_init("gimmie", gimmie_globals.version)

    _setup_session_manager()
    signal.signal(
        signal.SIGTERM,
        lambda x: _cancel_session_manager())  # Don't restart after kill

    try:
        topics = [
            ApplicationsTopic(),
            DocumentsTopic(),
            PeopleTopic(),
            ComputerTopic()
        ]
        load_it = lambda: _load_gimmie_bar(topics)

        gconf_bridge.connect("changed::swapbar", lambda gb: load_it())
        gconf_bridge.connect("changed::autohide", lambda gb: load_it())
        gconf_bridge.connect("changed::vertical", lambda gb: load_it())
        load_it()

        gtk.main()
    except (KeyboardInterrupt, SystemExit):
        # Don't restart if user pressed Ctrl-C, or sys.exit called
        _cancel_session_manager()
Exemplo n.º 2
0
def _show_help():
    try:
        import gnome
    except:
        print "You need python gnome module to use this help."
        return

    p = { gnome.PARAM_APP_DATADIR : '/usr/share' }
    gnome.program_init("ibus-xkbc", '1.0', properties=p)
    gnome.help_display("ibus-xkbc")
Exemplo n.º 3
0
def _show_help():
    try:
        import gnome
    except:
        print "You need python gnome module to use this help."
        return

    p = {gnome.PARAM_APP_DATADIR: '/usr/share'}
    gnome.program_init("ibus-xkbc", '1.0', properties=p)
    gnome.help_display("ibus-xkbc")
    def __init__(self,
                 app_name,
                 app_version,
                 filename,
                 top_window,
                 widget_list,
                 handlers,
                 pull_down_dict=None):
        '''
        __init__(self, app_name, app_version, filename, top_window, widget_list, pull_down_dict=None):
        
        app_name, app_version : application name and version 
        filename: filename of the .glade file
        top_window: the glade name of the top level widget (this will then
           be accessible as self.top_window)
        widget_list: a list of glade names; the dictionary self.widgets
           will be created that maps these name to the actual widget object
        pull_down_dict: a dictionary that maps combo names to a tuple of
            strings to put in the combo
        '''
        self.widget_list = widget_list

        try:
            search_path = GladeGnomeApp.search_path
        except:
            search_path = './'

        gnome.program_init(app_name, app_version)

        fname = search_file(filename, search_path)
        self.xml = gtk.glade.XML(fname, domain='sbackup')

        # prepare callbacks
        self.cb_dict = {}
        for f in handlers:
            self.cb_dict[f] = getattr(self, f)

        self.widgets = {}
        for w in self.widget_list:
            self.widgets[w] = self.xml.get_widget(w)

        if pull_down_dict is not None:
            for w, l in pull_down_dict.items():
                self.widgets[w].set_popdown_strings(l)

        # set attribute for top_window so it can be accessed as self.top_window
        self.top_window = self.xml.get_widget(top_window)

        # window to show when this one is hidden
        self.prev_window = None

        # initialize callback func
        self.cb_func = None
Exemplo n.º 5
0
def main():
    import gnome
    gnome.program_init("Prime", "0.01")
    pix = gtk.gdk.pixbuf_new_from_file(sibpath(__file__, "icon-active.png"))
    gtk.window_set_default_icon_list(pix)
    # global ne
    ne = NotificationEntry()
    from twisted.python import log
    import sys
    sys.stdin.close()
    log.startLogging(sys.stdout)
    reactor.run()
Exemplo n.º 6
0
def main():
    import gnome
    gnome.program_init("Prime", "0.01")
    pix = gtk.gdk.pixbuf_new_from_file(sibpath(__file__, "icon-active.png"))
    gtk.window_set_default_icon_list(pix)
    # global ne
    ne = NotificationEntry()
    from twisted.python import log
    import sys
    sys.stdin.close()
    log.startLogging(sys.stdout)
    reactor.run()
Exemplo n.º 7
0
def main():
    gnome.program_init('tray', SamplerConfig.version)
    unique = Service.unique()

    if unique:
        unique.dialog.run()

    else:
        import dbus
        bus = dbus.SessionBus()
        remote = bus.get_object('edu.wisc.cs.cbi.FirstTime', '/edu/wisc/cs/cbi/FirstTime')
        iface = dbus.Interface(remote, 'edu.wisc.cs.cbi.FirstTime')
        iface.present()
Exemplo n.º 8
0
def main():
    __pychecker__ = 'unusednames=tray'

    gnome.program_init('tray', SamplerConfig.version)
    unique = Service.unique()
    if not unique: return

    client = gconf.client_get_default()
    gconf_dir = GConfDir(client, Keys.root, gconf.CLIENT_PRELOAD_ONELEVEL)

    tray = TrayIcon(client)
    gtk.main()

    del gconf_dir
Exemplo n.º 9
0
 def handleGnomeSession(self):
     """ Define alguns handlers para eventos da sessão Gnome """
     try:
         import gnome
         import gnome.ui
     except:
         pass
     else:
         gnome.program_init(self.name, version)
         self.gclient = gnome.ui.master_client()
         #self.gclient = gnome.ui.Client()
         #self.gclient.connect_to_session_manager()
         self.gclient.connect("save-yourself", self.saveyourself)
         self.gclient.connect("die", self.die)
Exemplo n.º 10
0
def main():
    gnome.program_init('preferences', SamplerConfig.version)
    unique = Service.unique()

    if unique:
        unique.dialog.run()

    else:
        import dbus
        import gtk.gdk
        bus = dbus.SessionBus()
        remote = bus.get_object('edu.wisc.cs.cbi.Preferences',
                                '/edu/wisc/cs/cbi/Preferences')
        iface = dbus.Interface(remote, 'edu.wisc.cs.cbi.Preferences')
        iface.present()
        gtk.gdk.notify_startup_complete()
Exemplo n.º 11
0
    def __init__(self):
        self.program = gnome.program_init("notemeister", notemeister.const.version)
        self.Conf = notemeister.Configurator.Configurator()
        self.textview = notemeister.NoteView.NoteView(self.Conf)
        self.treeview = notemeister.NoteTree.NoteTree(self.textview)
        self.init_interface()
        self.treescroller.add(self.treeview)
        self.viewscroller.add(self.textview)

        self.treeview.connect("button_press_event", self.on_button_press_event)
        self.treeview.connect("doubleclick", self.on_doubleclick)

        self.treeview.loadNotes()

        tree_state = self.Conf.get_string("/apps/notemeister/tree_state")
        if len(self.treeview.noteList) > 0:
            path = self.treeview.restore_tree_state(tree_state)
            if len(path):
                self.treeview.set_cursor(path, None, gtk.FALSE)
        else:
            self.show_welcome()

        if self.Conf.enable_autosave:
            self.auto_save_notes()

        notemeister.utils.make_path(notemeister.const.dataPath)

        self.topWindow.show_all()
        gtk.main()
Exemplo n.º 12
0
def runit(splash=None):
    from netconfpkg import NC_functions
    from netconfpkg.NCException import NCException
    splash_window = None

    try:
        if splash:
            splash_window = splash_screen(True)
        import gnome
        import netconfpkg.gui.GUI_functions
        import netconfpkg
        netconfpkg.PRG_NAME = PRG_NAME
        from netconfpkg.gui.NewInterfaceDialog import NewInterfaceDialog
        from netconfpkg.gui.maindialog import mainDialog

        netconfpkg.gui.GUI_functions.PROGNAME = PROGNAME

        # make ctrl-C work
        signal.signal(signal.SIGINT, signal.SIG_DFL)

        progname = os.path.basename(sys.argv[0])

        gnome.program_init(PROGNAME, "scn")
        gtk.glade.bindtextdomain(PROGNAME, "/usr/share/locale")

        if progname == 'system-config-network-druid' or \
               progname == 'internet-druid':
            interface = NewInterfaceDialog()
            gtk.main()
            if interface.canceled:
                sys.exit(1)

        window = mainDialog()  # pylint: disable-msg=W0612

        if splash_window:
            splash_window.destroy()
            del splash_window

        gtk.main()

    except NCException, e:
        NC_functions.generic_error_dialog(str(e))
        return
Exemplo n.º 13
0
    def __init__(self, base, content_type, body):
        import cgi
        import gnome
        import gtk.glade
        import gtkhtml2
        import sys
        import BlipIcons
        import SamplerConfig
        import Paths
        import Signals

        argv = sys.argv
        sys.argv = [sys.argv[0]]
        gnome.program_init('wrapper', SamplerConfig.version)
        sys.argv = argv

        xml = gtk.glade.XML(Paths.glade)
        Signals.autoconnect(self, xml)
        self.__dialog = xml.get_widget('server-message')
        pixmap = self.__dialog.render_icon(BlipIcons.stock[True],
                                           BlipIcons.ICON_SIZE_EMBLEM, '')
        self.__dialog.set_icon(pixmap)

        document = gtkhtml2.Document()
        document.connect('request_url', self.on_request_url)
        document.connect('set_base', self.on_set_base)
        document.connect('link_clicked', self.on_link_clicked)
        document.connect('title_changed', self.on_title_changed)
        document.dialog = self.__dialog
        document.base = ''
        self.on_set_base(document, base)
        [mime_type, options] = cgi.parse_header(content_type)
        document.open_stream(mime_type)
        document.write_stream(body)
        document.close_stream()
        self.__document = document

        view = gtkhtml2.View()
        view.set_document(document)
        port = xml.get_widget('html-scroll')
        port.add(view)
        view.show()
Exemplo n.º 14
0
def help_docs(window):
    """Shell out to display help documents."""
    import platform
    if platform.system() == 'Windows':
        # shell out to explorer...
        pass
    else:
        import gnome
        props = {gnome.PARAM_APP_DATADIR:DB_PATH}
        prog = gnome.program_init('SCBdo', VERSION, properties=props)
        gnome.help_display('SCBdo')
Exemplo n.º 15
0
def help_docs(window):
    """Shell out to display help documents."""
    import platform
    if platform.system() == 'Windows':
        # shell out to explorer...
        pass
    else:
        import gnome
        props = {gnome.PARAM_APP_DATADIR: DB_PATH}
        prog = gnome.program_init('SCBdo', VERSION, properties=props)
        gnome.help_display('SCBdo')
Exemplo n.º 16
0
	def _read_glade(self, interface, glade_dir):
		glade_path = os.path.join(glade_dir, GLADE_FILE)
		if interface == INTERFACE_GNOME:
			try:
				xml_doc = dom_parse(glade_path)
				xml_glade_interface = xml_doc.getElementsByTagName("glade-interface")[0]
				xml_gnome_main = get_elements_by_attribute(xml_glade_interface, "widget", {"class":"GnomeApp"})[0]
				
				set_glade_icon(glade_path, xml_gnome_main)
				
				xml_main = get_elements_by_attribute(xml_glade_interface, "widget", {"class":"GtkWindow", "id":"main"})[0]
				xml_vbox = get_elements_by_attribute(xml_main.getElementsByTagName("child")[0], "widget", {"class":"GtkVBox", "id":"vbox"})[0]
				
				xml_placeholder = xml_gnome_main.getElementsByTagName("placeholder")[0]
				xml_gnome_child = xml_placeholder.parentNode
				
				xml_gnome_child.replaceChild(xml_vbox, xml_placeholder)
				xml_glade_interface.removeChild(xml_main)
				
				xml_gnome_main.attributes["id"].nodeValue = "main"
				
				xml_buf = xml_doc.toxml()
				
				import gnome
				gnome.program_init("PyCheckSum", "0.1")
				xml = gtk.glade.xml_new_from_buffer(xml_buf, len(xml_buf), 'main')
			except:
				print "Can't start as gnome app. Retrying as simple Gtk app..."
				return self._read_glade(INTERFACE_GTK)
		else:
			xml_doc = dom_parse(glade_path)
			xml_glade_interface = xml_doc.getElementsByTagName("glade-interface")[0]
			xml_glade_interface.removeChild(get_elements_by_attribute(xml_glade_interface, "widget", {"class":"GnomeApp"})[0])
			xml_glade_interface.removeChild(get_elements_by_attribute(xml_glade_interface, "requires", {"lib":"gnome"})[0])
			xml_glade_interface.removeChild(get_elements_by_attribute(xml_glade_interface, "requires", {"lib":"bonobo"})[0])
			
			set_glade_icon(glade_path, get_elements_by_attribute(xml_glade_interface, "widget", {"class":"GtkWindow", "id":"main"})[0])
			
			xml_buf = xml_doc.toxml()
			xml = gtk.glade.xml_new_from_buffer(xml_buf, len(xml_buf), 'main')
		return xml
Exemplo n.º 17
0
	def __init__(self):
		gnome.program_init(APP_NAME,APP_VERSION)
		# Create widget tree for the GUI and signal handlers
		self.__window = gtk.glade.XML('glade/window.glade','window')
		self.__window.signal_autoconnect(
			{
				'on_window_destroy'	: self.on_window_destroy,
				'on_new_activate'	: self.on_new_activate,
				'on_open_activate'	: self.on_open_activate,
				'on_pause_activate'	: self.on_pause_activate,
				'on_clear_activate'	: self.on_clear_activate,
				'on_prefs_activate' : self.on_prefs_activate,
				'on_about_activate'	: self.on_about_activate,
				'on_button_press_event'	: self.on_button_press_event,
			})
		# Save some pointers to specifig gui widgets
		self.__board = self.__window.get_widget('board')
		#for b in self.__board.get_children():
		#	b.modify_fg(gtk.STATE_INSENSITIVE,gdk.Color(60255,255,6660))
		self.__rowHints = self.__window.get_widget('rowHints')
		self.__colHints = self.__window.get_widget('columnHints')
		self.__level = self.__window.get_widget('level')
		self.__timeLeft = self.__window.get_widget('timeLeft')
		
		self.__desiredSkill = SKILL_MEDIUM
		self.__desiredPlayTime = 1800
		self.__gameOver = False
		self.__prefs_change = False
		
		# This will store the picross game
		self.__game = None
		self.__board.set_sensitive(False)
		self.__timer = GameTimer(delay=1,callback=self.__timerCallback)
		self.__timer.setDaemon(True)
		# Start the gtk main event loop and allow multiple threads to 
		# serialize access to the Python interpreter
		
		gdk.threads_init()
		#self.__timer.start()
		gtk.main()
Exemplo n.º 18
0
def browse_url(url):
    global gnome_initted

    if sys.platform == 'win32':
        try:
            import webbrowser
            webbrowser.open_new(url)
        except:
            raise error.Error('Opening a browser failed.')
    elif settings.gtk_loaded():
        try:
            import gnome
        except:
            gnome = None

        if gnome and not gnome_initted:
            gnome.program_init('circle',__init__.__version__)
            gnome_initted = 1

        if gnome:
            gnome.url_show(url)
        else:
            if not os.fork():
                try:
                    os.execlp('gnome-moz-remote','gnome-moz-remote','--newwin',url)
                except:
                    try:
                        os.execlp('mozilla','mozilla',url)
                    except:
                        raise error.Error('Opening a browser failed.')
    else:
        try:
            #if not os.fork():
                #os.execlp('lynx','lynx',url)
            os.system("lynx "+quote_for_shell(url))
        except:
            raise error.Error('Opening a browser failed.')
Exemplo n.º 19
0
    def __init__(self, name, version, humanName, gladeFile, root):
        """Initialise program 'name' and version from 'file' containing root node 'root'.
        """
        props = {
            gnome.PARAM_HUMAN_READABLE_NAME: humanName,
            gnome.PARAM_APP_DATADIR: paths.datadir,
            gnome.PARAM_APP_LIBDIR: paths.datadir,
            gnome.PARAM_APP_PREFIX: paths.prefix,
            gnome.PARAM_APP_SYSCONFDIR: paths.sysconfdir,
        }

        self.program = gnome.program_init(name, version, properties=props)

        gladeXML = uninstalled_file(gladeFile)
        if gladeXML == None:
            filename = os.path.join(name, gladeFile)
            gladeXML = self.program.locate_file(gnome.FILE_DOMAIN_APP_DATADIR, filename, True)
            if gladeXML == []:
                ### FIXME: Need to use something less generic than this
                raise Exception("Unable to locate %s" % (filename))
            else:
                gladeXML = gladeXML[0]

        GtkApp.__init__(self, gladeXML, root)

        if 0:
            self.client = gnome.ui.Client()
            self.client.disconnect()

            def connected(*args):
                print "CONNECTED", args

            def cb(name):
                def cb2(*args):
                    print name, args, "\n"

                return cb2

            self.client.connect("connect", cb("CON"))
            self.client.connect("die", cb("DIE"))
            self.client.connect("disconnect", cb("DIS"))
            self.client.connect("save-yourself", cb("SAVE"))
            self.client.connect("shutdown-cancelled", cb("CAN"))
            self.client.connect_to_session_manager()
try:
    import pygtk
    #tell pyGTK, if possible, that we want GTKv2
    pygtk.require("2.0")
  
except:
    #Some distributions come with GTK2, but not pyGTK
    pass

try:
    import gtk
    import gtk.glade
    import gnome
    import pynotify
  
except:
    print _("You need to install pyGTK or GTKv2,\n"
            "or set your PYTHONPATH correctly.\n"
            "try: export PYTHONPATH= ")
    sys.exit(1)

gnome.program_init("mount-systray", "0.1")

device_manager = MSDeviceManager()
conf = MSConfig()
MSSystray(device_manager, conf)

pynotify.init("mount-systray")
gtk.main()
Exemplo n.º 21
0
		# no options were passed
		print "WARNING: Unknown arguments passed, using defaults."
		opts = []
		args = sys.argv[1:]
	
	for o, a in opts:
		if o in ("-h", "--help"):
			usage()
		elif o in ("-w", "--window"):
			standalone = True

	print 'Running with options:', {
		'standalone': standalone,
	}
	
	gnome.program_init('glipper', '1.0', properties= { gnome.PARAM_APP_DATADIR : glipper.DATA_DIR })
	set_process_name()

	if standalone:
		import gnome
		gnome.init(glipper.defs.PACKAGE, glipper.defs.VERSION)
		set_process_name()
		build_window()
		
		gtk.main()
		
	else:
		gnomeapplet.bonobo_factory(
			"OAFIID:Glipper_Factory",
			gnomeapplet.Applet.__gtype__,
			glipper.defs.PACKAGE,
Exemplo n.º 22
0
            folder = header.get_folder()
            msg = folder.get_msg(header)
            msgview.set_msg(msg)


def on_folderstree_selected(treeselection, headerstree):
    model, iter = treeselection.get_selected()
    folder = model.get_value(
        iter, tinymail.uigtk.GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN)
    if folder:
        progressbar.show()
        folder.refresh_async(on_refresh_folder, on_status, headerstree)


props = {gnome.PARAM_APP_DATADIR: "/usr/share"}
pr = gnome.program_init("E-Mail", "1.0", properties=props)
xml = gtk.glade.XML("tinymail-python-test.glade", domain="email")
widget = xml.get_widget("window")
progressbar = xml.get_widget("progressbar")
progressbar.hide()
folderstree = xml.get_widget("folderstree")
headerstree = xml.get_widget("headerstree")
vpaned = xml.get_widget("vpaned")
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn("Folder", renderer, text=0)
column.set_fixed_width(100)
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
folderstree.append_column(column)
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn("From", renderer, text=0)
column.set_fixed_width(100)
Exemplo n.º 23
0
    kwargs = {}
    if sys.version_info < (3,):
        kwargs['unicode'] = True
    gettext.install(PROGNAME,
                    localedir="/usr/share/locale",
                    codeset='utf-8',
                    **kwargs)
except:
    try:
        import builtins
        builtins.__dict__['_'] = str
    except ImportError:
        import __builtin__
        __builtin__.__dict__['_'] = unicode

gnome.program_init("SELinux Management Tool", "5")

version = "1.0"

sys.path.append('/usr/share/system-config-selinux')


##
## Pull in the Glade file
##
if os.access("system-config-selinux.glade", os.F_OK):
    xml = gtk.glade.XML("system-config-selinux.glade", domain=PROGNAME)
else:
    xml = gtk.glade.XML("/usr/share/system-config-selinux/system-config-selinux.glade", domain=PROGNAME)

Exemplo n.º 24
0
		os.putenv("DESKTOP_AUTOSTART_ID", "")
		self._enabled = succ
		if not self.enabled:
			self.output_info("Warning: Not able to connect to current "
				"desktop session, please Quit before logout to save "
				"kupfer's data.")

	def _connect_gnomeui(self):
		try:
			import gnome
			import gnome.ui
		except ImportError, exc:
			self.output_debug(exc)
			return False

		gnome.program_init(version.PACKAGE_NAME, version.VERSION)
		client = gnome.ui.master_client()
		client.connect("save-yourself", self._session_save)
		client.connect("die", self._session_die)
		self.output_debug("Setting up session connection using GnomeClient")
		return True

	def _connect_session_manager(self):
		bus = dbus.SessionBus()
		proxy_obj = bus.get_object('org.freedesktop.DBus',
				'/org/freedesktop/DBus')
		dbus_iface = dbus.Interface(proxy_obj, 'org.freedesktop.DBus')
		service_name = "org.gnome.SessionManager"
		obj_name = "/org/gnome/SessionManager"
		iface_name = service_name
Exemplo n.º 25
0
##
PROGNAME = "policycoreutils"

import gettext
gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
gettext.textdomain(PROGNAME)
try:
    gettext.install(PROGNAME,
                    localedir="/usr/share/locale",
                    unicode=False,
                    codeset='utf-8')
except IOError:
    import builtins
    builtins.__dict__['_'] = str

gnome.program_init("SELinux Policy Generation Tool", "5")

version = "1.0"

sys.path.append('/usr/share/system-config-selinux')
sys.path.append('.')


# From John Hunter http://www.daa.com.au/pipermail/pygtk/2003-February/004454.html
def foreach(model, path, iter, selected):
    selected.append(model.get_value(iter, 0))


##
## Pull in the Glade file
##
Exemplo n.º 26
0
        """
        self.filechooserdialog_open.show_all()
    
    def on_button_fileopen_cancel_clicked(self, widget, data=None):
        """
        2015.01.23
        """
        self.filechooserdialog_open.hide()
        
    
    def on_button_fileopen_ok_clicked(self, widget, data=None):
        """
        2009-3-13
        """
        input_fname = self.filechooserdialog_open.get_filename()
        sampling_probability = float(self.entry_sampling_probability.get_text())
        self.filechooserdialog_open.hide()
        self.readInDataToPlot(input_fname, sampling_probability)
    
    def on_entry_plot_title_change(self, widget, data=None):
        """
        2009-3-13
            upon any change in the entry_plot_title
        """
        self.plot_title = self.entry_plot_title.get_text()
    
if __name__ == '__main__':
    prog = gnome.program_init('DataMatrixGUI', '0.1')
    instance = DataMatrixGUI()
    gtk.main()
Exemplo n.º 27
0
        print "WARNING: Unknown arguments passed, using defaults."
        opts = []
        args = sys.argv[1:]

    for o, a in opts:
        if o in ("-h", "--help"):
            usage()
        elif o in ("-w", "--window"):
            standalone = True

    print 'Running with options:', {
        'standalone': standalone,
    }

    gnome.program_init('glipper',
                       '1.0',
                       properties={gnome.PARAM_APP_DATADIR: glipper.DATA_DIR})
    set_process_name()

    if standalone:
        import gnome
        gnome.init(glipper.defs.PACKAGE, glipper.defs.VERSION)
        set_process_name()
        build_window()

        gtk.main()

    else:
        gnomeapplet.bonobo_factory("OAFIID:Glipper_Factory",
                                   gnomeapplet.Applet.__gtype__,
                                   glipper.defs.PACKAGE, glipper.defs.VERSION,
            

    dialog.destroy()
    if ret == gtk.RESPONSE_OK:
        autorun(mount, program_to_spawn)


if __name__=="__main__":
    # use nautilus translations
    # TODO: custom translations with new strings
    gettext.bindtextdomain("nautilus", "/usr/share/locale")
    gettext.bind_textdomain_codeset("nautilus", "UTF-8")
    gettext.textdomain("nautilus")
    
    
    app = gnome.program_init ("secure-nautilus-autorun", __version__,
                               gnome.libgnome_module_info_get(), sys.argv, []);


    if len(sys.argv)!=2:
        sys.exit(0)

    # instantiate monitor so we get the "unmounted" signal properly
    monitor = gio.volume_monitor_get()
    if not monitor:
        sys.exit(-1)
    
    file = gio.File(sys.argv[1])
    if not file:
        sys.exit(-2)

    mount = file.find_enclosing_mount()
Exemplo n.º 29
0
import sys
pygtk.require('2.0')

import gtk
import gnome
import gnome.ui
import gnomeapplet
import subprocess
import gobject

from colorpicker.globals import *
from colorpicker.preferences import *

MAX_HISTORY = 16

gnome.program_init("colorpicker", "1.0")

def color_to_string(clr):
    return '#%02x%02x%02x' % (clr.red/256, clr.green/256, clr.blue/256)

def lighten(clr):
    newclr = gtk.gdk.Color(clr.red+(16*256), clr.green+(16*256), clr.blue+(16*256))
    if newclr.red > 65535:
        newclr.red = 65535
    if newclr.green > 65535:
        newclr.green = 65535
    if newclr.blue > 65535:
        newclr.blue = 65535
    return newclr

def darken(clr):
Exemplo n.º 30
0
			# Make the outline light
			original_weight = widget.get_data('original_weight')
			widget.set(weight=original_weight)
			return True
		return False
	
	def on_button_row_rate_clicked(self, widget, data=None):
		"""
		2008-02-06
		"""
		if self.qc_class_ins:
			self.qc_class_ins.plot_row_NA_mismatch_rate('%s vs %s strain-wise'%(os.path.basename(self.input_fname1), os.path.basename(self.input_fname2)))
		else:
			self.app_input_appbar.push("Error: Instantiate Class First!")
	
	def on_button_col_rate_clicked(self, widget, data=None):
		"""
		2008-02-06
		"""
		if self.qc_class_ins:
			self.qc_class_ins.plot_col_NA_mismatch_rate('%s vs %s snp-wise'%(os.path.basename(self.input_fname1), os.path.basename(self.input_fname2)))
		else:
			self.app_input_appbar.push("Error: Instantiate Class First!")
		

prog = gnome.program_init('QCVisualizeII', '0.1')
#prog.set_property('app-datadir', '/usr/share')
#prog.set_property('default-icon', '/usr/share/pixmaps/apple-green.png')
instance = QCVisualizeII()
gtk.main()
def create_gnome_app( cfg ):
	gnome_props = { gnome.PARAM_APP_DATADIR : '/usr/share' }
	return gnome.program_init( 'backintime', cfg.VERSION, properties = gnome_props )
Exemplo n.º 32
0
Arquivo: misc.py Projeto: aszeszo/test
def init_for_help(application_dir="/"):
        props = { gnome.PARAM_APP_DATADIR : os.path.join(application_dir,
                    'usr/share/package-manager/help') }
        gnome.program_init('package-manager', '0.1', properties=props)
Exemplo n.º 33
0
            fd = os.open(self.config.named_pipe, os.O_RDONLY | os.O_NONBLOCK)
        except OSError, e:
            dialog = ErrorDialog(self.root_widget, "Unable to open file",
                                 "The file '%s' cannot be read. Please check "
                                 "the permissions and try again." %
                                 self.config.named_pipe)
            dialog.run()
            dialog.destroy()
            sys.exit()
        else:
            gobject.io_add_watch(fd, gobject.IO_IN, self.read_pipe)
        
    def on_app1_delete_event(self, *args):
        self.toggle_visibility()
        return True


def main():
    config = Config(gconf.client_get_default())
    if config.is_first_run():
        window = WelcomeDruid(config)
        window.show()
    else:
        window = MainWindow(config)
    gtk.main()


if __name__ == "__main__":
    program = gnome.program_init("bandsaw", __VERSION__)
    main()
Exemplo n.º 34
0
	Requires PyGtk 2.6	
	Released under the terms of the revised BSD license
	Modified: 2015-12-21
"""

from __future__ import division
import sys, os, gtk, pango, ConfigParser
#import math
from math import *

app_version = "1.3.3"

try:
    import gnome
    props = {gnome.PARAM_APP_DATADIR: '/usr/share'}
    prog = gnome.program_init("lybniz", str(app_version), properties=props)
except:
    print "Gnome not found"

import gettext

gettext.install('lybniz')

# profiling
enable_profiling = False
if enable_profiling:
    from time import time

app_win = None
actions = gtk.ActionGroup("General")
graph = None
Exemplo n.º 35
0
				win.show_all()
	
	def on_button_refresh_interval_clicked(self, widget=None, data=None):
		"""
		2009-11-10
			set the refresh interval in the node_queue_app (checking status of nodes in the queue
		"""
		entry_checking_interval = self.xml.get_widget("entry_checking_interval")
		self.backend_ins.checkStatusOfNodesInQueue()
		if self.node_queue_refresh_timeout_source_id is not None:
			gobject.source_remove(self.node_queue_refresh_timeout_source_id)
		interval_str = entry_checking_interval.get_text()
		if not interval_str:
			interval_str = '10m'	#default is 10m
		interval = self.getTimeIntervalFromStr(interval_str)
		self.node_queue_refresh_timeout_source_id = gobject.timeout_add(interval, self.backend_ins.checkStatusOfNodesInQueue)
		self.displayQueueWindow()
	
	def on_button_stop_node_status_refresh_clicked(self, widget, data=None):
		"""
		2009-11-10
			remove the timeout function
		"""
		if self.node_queue_refresh_timeout_source_id is not None:
			gobject.source_remove(self.node_queue_refresh_timeout_source_id)
		
if __name__ == '__main__':
	prog = gnome.program_init('ClusterJobManager', '0.1')
	instance = grid_job_mgr()
	gtk.main()
Exemplo n.º 36
0
try:
    import pygtk
    #tell pyGTK, if possible, that we want GTKv2
    pygtk.require("2.0")

except:
    #Some distributions come with GTK2, but not pyGTK
    pass

try:
    import gtk
    import gtk.glade
    import gnome
    import pynotify

except:
    print _("You need to install pyGTK or GTKv2,\n"
            "or set your PYTHONPATH correctly.\n"
            "try: export PYTHONPATH= ")
    sys.exit(1)

gnome.program_init("mount-systray", "0.1")

device_manager = MSDeviceManager()
conf = MSConfig()
MSSystray(device_manager, conf)

pynotify.init("mount-systray")
gtk.main()
Exemplo n.º 37
0
    def on_message_arrived(self, message):
        buf = self.glade.get_widget("ReceiveText").get_buffer()

        info = dict(message[1][0])
        info['tags'] = '; '.join(message[0])
        buf.insert(buf.get_end_iter(), "%(tags)s\n%(content)s\n\n" % info)
    
class MainWindow(EpicenterWidget):
    def __init__(self, bus, **kw):
        self.bus = bus
        self.storage = dbus.Interface(
            bus.get_object('org.redhog.epicenter',
                           '/org/redhog/epicenter/storage'),
            dbus_interface='org.redhog.epicenter.storage')
        EpicenterWidget.__init__(self, **kw)

    def on_NewPage_clicked(self, button):
        searches = self.glade.get_widget("Searches")
        page_nr = searches.get_n_pages() - 1
        content = SearchContent(parent = self)
        header = SearchHeader(parent = self, content = content)
        searches.insert_page(content.widget, header.widget, page_nr)

    def on_MainWindow_delete_event(self, window, event):
        gtk.main_quit()

gnome.program_init("Epicenter", "0.01")
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
MainWindow(dbus.SessionBus())
gtk.main()
Exemplo n.º 38
0
def create_gnome_app(cfg):
    gnome_props = {gnome.PARAM_APP_DATADIR: '/usr/share'}
    return gnome.program_init('backintime',
                              cfg.VERSION,
                              properties=gnome_props)
Exemplo n.º 39
0
	Requires PyGtk 2.6	
	Released under the terms of the revised BSD license
	Modified: 2015-12-21
"""

from __future__ import division
import sys, os, gtk, pango, ConfigParser
#import math
from math import *

app_version = "1.3.3"

try:
	import gnome
	props = {gnome.PARAM_APP_DATADIR : '/usr/share'}
	prog = gnome.program_init("lybniz", str(app_version), properties=props)
except:
	print "Gnome not found"


import gettext
gettext.install('lybniz')

# profiling
enable_profiling = False
if enable_profiling:
	from time import time

app_win = None
actions = gtk.ActionGroup("General")
graph = None
Exemplo n.º 40
0
        return False

    def on_button_row_rate_clicked(self, widget, data=None):
        """
		2008-02-06
		"""
        if self.qc_class_ins:
            self.qc_class_ins.plot_row_NA_mismatch_rate(
                '%s vs %s strain-wise' % (os.path.basename(
                    self.input_fname1), os.path.basename(self.input_fname2)))
        else:
            self.app_input_appbar.push("Error: Instantiate Class First!")

    def on_button_col_rate_clicked(self, widget, data=None):
        """
		2008-02-06
		"""
        if self.qc_class_ins:
            self.qc_class_ins.plot_col_NA_mismatch_rate(
                '%s vs %s snp-wise' % (os.path.basename(
                    self.input_fname1), os.path.basename(self.input_fname2)))
        else:
            self.app_input_appbar.push("Error: Instantiate Class First!")


prog = gnome.program_init('QCVisualizeII', '0.1')
#prog.set_property('app-datadir', '/usr/share')
#prog.set_property('default-icon', '/usr/share/pixmaps/apple-green.png')
instance = QCVisualizeII()
gtk.main()
Exemplo n.º 41
0
def init_for_help(application_dir="/"):
    props = {
        gnome.PARAM_APP_DATADIR:
        os.path.join(application_dir, 'usr/share/package-manager/help')
    }
    gnome.program_init('package-manager', '0.1', properties=props)
Exemplo n.º 42
0
def main():
    gnome.program_init(NAME, VERSION)
    config = Configuration()
    newt = Newton(config, 'window')
    newt.toggle_window_visible()
    gtk.main()
Exemplo n.º 43
0
		"""
		self.filechooserdialog_open.show_all()
	
	def on_button_fileopen_cancel_clicked(self, widget, data=None):
		"""
		2015.01.23
		"""
		self.filechooserdialog_open.hide()
		
	
	def on_button_fileopen_ok_clicked(self, widget, data=None):
		"""
		2009-3-13
		"""
		input_fname = self.filechooserdialog_open.get_filename()
		sampling_probability = float(self.entry_sampling_probability.get_text())
		self.filechooserdialog_open.hide()
		self.readInDataToPlot(input_fname, sampling_probability)
	
	def on_entry_plot_title_change(self, widget, data=None):
		"""
		2009-3-13
			upon any change in the entry_plot_title
		"""
		self.plot_title = self.entry_plot_title.get_text()
	
if __name__ == '__main__':
	prog = gnome.program_init('DataMatrixGuiXYProbe', '0.1')
	instance = DataMatrixGuiXYProbe()
	gtk.main()
  Unable to initialize graphical environment. Most likely cause of failure
  is that the tool was not run using a graphical environment. Please either
  start your graphical user interface or set your DISPLAY variable.
                                                                                
  Caught exception: %s
""") % e
    sys.exit(-1)

from lvm_model import lvm_model, lvm_conf_get_locking_type
from Volume_Tab_View import Volume_Tab_View
from lvmui_constants import *

import gnome
import gnome.ui

gnome.program_init(PROGNAME, VERSION)
gnome.app_version = VERSION
FORMALNAME = _("system-config-lvm")
ABOUT_VERSION = _("%s %s") % ('system-config-lvm', VERSION)

from execute import execWithCapture
from Cluster import Cluster


###############################################
class baselvm:
    def __init__(self, glade_xml, app):

        # check locking type
        locking_type = lvm_conf_get_locking_type()
        if locking_type != 1:
Exemplo n.º 45
0
    action="store_true",
    dest="as_extension",
    help="usar interface reducida, apropiada para administradores de ficheiros",
)
parser.add_option("-s", "--standalone", action="store_false", dest="as_extension", help="usar interface completa")
parser.add_option(
    "-u", "--uri-list", action="store_true", dest="as_uris", help="tratamento de URIs, no lugar de ficheiros locais"
)
parser.add_option("--show-initial-warning", action="store_true", dest="initial_warning")

options, input_files = parser.parse_args()

if not input_files:
    options.as_extension = False

gnome.program_init(constants.name, constants.version)


class Info:
    pass


class Callbacks:
    def __init__(self):
        self.file_selection_work_pending = False
        self.non_local_warning_message_visible = False
        self.selection_info_visible = False
        if options.initial_warning:
            self.show_non_local_warning()
        self.complete_can_close = False
        self.dirs = {}
Exemplo n.º 46
0
def get_app():
	program = gnome.program_init("gstratatest", "1.0")
	app = GStrataTest("GStrataTest", "GStrataTest")
	xml = gtk.glade.XML("gstratatest.glade")
	xml.signal_autoconnect(app)
	return app
Exemplo n.º 47
0
##
PROGNAME="policycoreutils"

import gettext
gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
gettext.textdomain(PROGNAME)
try:
    gettext.install(PROGNAME,
                    localedir="/usr/share/locale",
                    unicode=False,
                    codeset = 'utf-8')
except IOError:
    import __builtin__
    __builtin__.__dict__['_'] = unicode

gnome.program_init("SELinux Policy Generation Tool", "5")

version = "1.0"

sys.path.append('/usr/share/system-config-selinux')
sys.path.append('.')

# From John Hunter http://www.daa.com.au/pipermail/pygtk/2003-February/004454.html
def foreach(model, path, iter, selected):
    selected.append(model.get_value(iter, 0))

##
## Pull in the Glade file
##
if os.access("polgen.glade", os.F_OK):
    xml = gtk.glade.XML ("polgen.glade", domain=PROGNAME)
Exemplo n.º 48
0
		"""
		2009-3-13
		"""
		delimiter = figureOutDelimiter(input_fname)
		self.header, self.strain_acc_list, self.category_list, self.data_matrix = read_data(input_fname, delimiter=delimiter)
		
	def on_imagemenuitem_open_activate(self, widget, data=None):
		"""
		2009-3-13
		"""
		self.filechooserdialog_open.show_all()
	
	def on_button_fileopen_ok_clicked(self, widget, data=None):
		"""
		2009-3-13
		"""
		input_fname = self.filechooserdialog_open.get_filename()
		self.filechooserdialog_open.hide()
		self.readInDataToPlot(input_fname)
	
	def on_entry_plot_title_change(self, widget, data=None):
		"""
		2009-3-13
			upon any change in the entry_plot_title
		"""
		self.plot_title = self.entry_plot_title.get_text()
	
if __name__ == '__main__':
	prog = gnome.program_init('DataMatrixGuiXYProbe', '0.1')
	instance = DataMatrixGuiXYProbe()
	gtk.main()
Exemplo n.º 49
0
	def __init__(self, start_hidden, tray_icon):
		super(Browser, self).__init__()
		self.glade=Gtk.glade.XML(utils.get_data_file_name('labyrinth.glade'))
		self.view = self.glade.get_widget ('MainView')
		self.populate_view ()
		self.view.connect ('row-activated', self.open_row_cb)
		self.view.connect ('cursor-changed', self.cursor_change_cb)

		self.view_dependants = []

		self.open_button = self.glade.get_widget('OpenButton')
		self.delete_button = self.glade.get_widget('DeleteButton')
		self.open_menu = self.glade.get_widget('open1')
		self.delete_menu = self.glade.get_widget('delete1')

		self.view_dependants.append (self.open_button)
		self.view_dependants.append (self.delete_button)
		self.view_dependants.append (self.open_menu)
		self.view_dependants.append (self.delete_menu)

		self.open_button.connect ('clicked', self.open_clicked)
		self.glade.get_widget('NewButton').connect ('clicked', self.new_clicked)
		self.delete_button.connect ('clicked', self.delete_clicked)

		self.open_menu.connect ('activate', self.open_clicked)
		self.glade.get_widget('new1').connect ('activate', self.new_clicked)
		self.delete_menu.connect ('activate', self.delete_clicked)
		self.glade.get_widget('import1').connect ('activate', self.import_clicked)
		self.glade.get_widget('quit1').connect ('activate', self.quit_clicked)
		self.glade.get_widget('about1').connect ('activate', self.about_clicked)
		self.glade.get_widget('showhelp').connect ('activate', self.show_help_clicked)

		map(lambda x : x.set_sensitive(False), self.view_dependants)

		props = { gnome.PARAM_APP_DATADIR : '/usr/share' }
		prog = gnome.program_init('labyrinth', '0.5', properties=props)

		self.main_window = self.glade.get_widget ('MapBrowser')
		
		# set remembered size
		if os.name != 'nt':
			self.config_client = GConf.Client.get_default()
			self.config_client.add_dir ("/apps/labyrinth", GConf.ClientPreloadType.PRELOAD_NONE)

			width = self.config_client.get_int ('/apps/labyrinth/width')
			height = self.config_client.get_int ('/apps/labyrinth/height')
			utils.use_bezier_curves = self.config_client.get_bool ('/apps/labyrinth/curves')
			if width == 0 or height == 0:
				width = 400
				height = 300
		else:
			width = 400
			height = 300

		view_sortable = self.view.get_model ()
		view_sortable.connect ('sort-column-changed', self.sort_column_changed_cb)
		if os.name != 'nt':
			sort_order = self.config_client.get_int('/apps/labyrinth/map_sort_order')
			column_id = self.config_client.get_int('/apps/labyrinth/map_sort_order_column')
			view_sortable.set_sort_column_id (column_id, sort_order)

		self.main_window.resize (width, height)

		if os.name != 'nt':
			try:
				self.main_window.set_icon_name ('labyrinth')
			except:
				self.main_window.set_icon_from_file(utils.get_data_file_name('labyrinth.svg'))
		else:
			self.main_window.set_icon_from_file('images\\labyrinth-24.png')
		if tray_icon:
			self.main_window.connect ('delete_event', self.toggle_main_window, None)
			traymenu = Gtk.Menu()
			quit_item = Gtk.MenuItem("Quit")
			quit_item.connect("activate",self.quit_clicked)
			traymenu.add(quit_item)
			traymenu.show_all()
			self.traymenu = traymenu
			self.trayicon = TrayIcon.TrayIcon(
							icon_name="labyrinth",
							menu=traymenu,
							activate=self.toggle_main_window)
		else:
			self.main_window.connect('delete_event', self.quit_clicked, None)
		if start_hidden:
			self.main_window.hide ()
		else:
			self.main_window.show_all ()
Exemplo n.º 50
0
	def __init__(self, plot_title='', id_is_strain=1, header=None, strain_acc_list=None, category_list=None, data_matrix=None):
		"""
		2008-01-10
			use a paned window to wrap the scrolledwindow and the canvas
			so that the relative size of canvas to the scrolledwindow could be adjusted by the user.
		"""
		prog = gnome.program_init('DataMatrixGuiXYProbe', '0.1')	#this must be called before any initialization for gnome app
		
		program_path = os.path.dirname(__init__.__file__)	#sys.argv[0])
		xml = gtk.glade.XML(os.path.join(program_path, 'DataMatrixGuiXYProbe.glade'))
		xml.signal_autoconnect(self)
		self.app1 = xml.get_widget("app1")
		self.app1.connect("delete_event", gtk.main_quit)
		self.app1.set_default_size(800, 1000)
		self.app1.set_title(plot_title)
		
		self.plot_title = plot_title
		self.id_is_strain = id_is_strain
		self.header = header
		self.strain_acc_list = strain_acc_list
		self.category_list = category_list
		self.data_matrix = data_matrix
		
		self.column_types = None
		self.column_header = None
		self.column_editable_flag_ls = None
		self.list_2d = None
		
		
		self.column_types = None
		self.list_2d = None
		self.column_header = None
		self.editable_flag_ls = None
		
		self.vbox1 = xml.get_widget("vbox1")
		self.treeview_matrix = xml.get_widget("treeview_matrix")
		
		# matplotlib stuff
		fig = Figure(figsize=(8,8))
		self.canvas = FigureCanvas(fig)  # a gtk.DrawingArea
		self._idClick = self.canvas.mpl_connect('button_press_event', self.on_click)
		self.vpaned1 = xml.get_widget("vpaned1")
		self.vpaned1.add2(self.canvas)
		
		#vbox.pack_start(self.canvas, True, True)
		self.ax = fig.add_subplot(111)
		self.treeview_matrix.connect('row-activated', self.plot_row)
		
		toolbar = NavigationToolbar(self.canvas, self.app1)
		self.vbox1.pack_start(toolbar, False, False)
		
		self.checkbutton_label_dot = xml.get_widget('checkbutton_label_dot')
		self.entry_dot_label_column = xml.get_widget('entry_dot_label_column')
		self.entry_x_column = xml.get_widget('entry_x_column')
		self.entry_y_column = xml.get_widget('entry_y_column')
		self.entry_hist_column = xml.get_widget('entry_hist_column')
		self.entry_no_of_bins = xml.get_widget('entry_no_of_bins')	#2009-5-20
		self.entry_plot_title = xml.get_widget('entry_plot_title')
		self.entry_plot_title.set_text(self.plot_title)
		
		self.filechooserdialog_save = xml.get_widget("filechooserdialog_save")
		self.filechooserdialog_save.connect("delete_event", yh_gnome.subwindow_hide)
		
		self.filechooserdialog_open = xml.get_widget("filechooserdialog_open")
		self.filechooserdialog_open.connect("delete_event", yh_gnome.subwindow_hide)
		
		self.app1_appbar1 = xml.get_widget('app1_appbar1')
		self.app1_appbar1.push('Status Message.')	#import gnome.ui has to be executed.
		
		self.treeview_matrix.connect('cursor-changed', self.update_no_of_selected, self.app1_appbar1)
		self.app1.show_all()
Exemplo n.º 51
0
##
PROGNAME = "policycoreutils"

import gettext
gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
gettext.textdomain(PROGNAME)
try:
    gettext.install(PROGNAME,
                    localedir="/usr/share/locale",
                    unicode=False,
                    codeset='utf-8')
except IOError:
    import __builtin__
    __builtin__.__dict__['_'] = unicode

gnome.program_init("SELinux Management Tool", "5")

version = "1.0"

sys.path.append('/usr/share/system-config-selinux')

##
## Pull in the Glade file
##
if os.access("system-config-selinux.glade", os.F_OK):
    xml = gtk.glade.XML("system-config-selinux.glade", domain=PROGNAME)
else:
    xml = gtk.glade.XML(
        "/usr/share/system-config-selinux/system-config-selinux.glade",
        domain=PROGNAME)
Exemplo n.º 52
0
        self._enabled = succ
        if not self.enabled:
            self.output_info(
                "Warning: Not able to connect to current "
                "desktop session, please Quit before logout to save "
                "kupfer's data.")

    def _connect_gnomeui(self):
        try:
            import gnome
            import gnome.ui
        except ImportError, exc:
            self.output_debug(exc)
            return False

        gnome.program_init(version.PACKAGE_NAME, version.VERSION)
        client = gnome.ui.master_client()
        client.connect("save-yourself", self._session_save)
        client.connect("die", self._session_die)
        self.output_debug("Setting up session connection using GnomeClient")
        return True

    def _connect_session_manager(self):
        bus = dbus.SessionBus()
        proxy_obj = bus.get_object('org.freedesktop.DBus',
                                   '/org/freedesktop/DBus')
        dbus_iface = dbus.Interface(proxy_obj, 'org.freedesktop.DBus')
        service_name = "org.gnome.SessionManager"
        obj_name = "/org/gnome/SessionManager"
        iface_name = service_name
Exemplo n.º 53
0
    def __init__(self, plot_title='', id_is_strain=1, header=None,
        strain_acc_list=None, category_list=None, data_matrix=None):
        """
        2008-01-10
            use a paned window to wrap the scrolledwindow and the canvas
            so that the relative size of canvas to the scrolledwindow could be adjusted by the user.
        """
        prog = gnome.program_init('DataMatrixGUI', '0.1')
        #this must be called before any initialization for gnome app
        
        program_path = os.path.dirname(__init__.__file__)
        xml = gtk.glade.XML(os.path.join(program_path, 'DataMatrixGUI.glade'))
        xml.signal_autoconnect(self)
        self.app1 = xml.get_widget("app1")
        self.app1.connect("delete_event", gtk.main_quit)
        self.app1.set_default_size(800, 1000)
        self.app1.set_title(plot_title)
        
        self.plot_title = plot_title
        self.id_is_strain = id_is_strain
        self.header = header
        self.strain_acc_list = strain_acc_list
        self.category_list = category_list
        self.data_matrix = data_matrix
        
        self.inputDataHeaders = None
        
        self.columnTypes = None
        self.columnHeaders = None
        self.columnEditableFlagList = None
        self.list2D = None
        
        self.vbox1 = xml.get_widget("vbox1")
        self.treeview_matrix = xml.get_widget("treeview_matrix")
        
        # matplotlib stuff
        fig = Figure(figsize=(8,8))
        
        self.canvas = FigureCanvas(fig)  # a gtk.DrawingArea
        self._idClick = self.canvas.mpl_connect('button_press_event', self.onUserClickCanvas)
        self.vpaned1 = xml.get_widget("vpaned1")
        self.vpaned1.add2(self.canvas)
        
        #self.vbox1.pack_start(self.canvas, True, True)
        self.ax = fig.add_subplot(111)

        self.treeview_matrix.connect('row-activated', self.plot_row)
        
        toolbar = NavigationToolbar(self.canvas, self.app1)
        self.vbox1.pack_start(toolbar, False, False)
        
        self.checkbutton_label_dot = xml.get_widget('checkbutton_label_dot')
        self.entry_dot_label_column = xml.get_widget('entry_dot_label_column')
        self.dataLabelColumnIndexAndSeparatorList = None
        self.dataLabelNumericItemIndexList = None 
        
        self.entry_x_na = xml.get_widget('entry_x_na')
        self.entry_y_na = xml.get_widget('entry_y_na')
        
        self.entry_multiply_x = xml.get_widget('entry_multiply_x')
        self.entry_multiply_y = xml.get_widget('entry_multiply_y')
        self.entry_add_x = xml.get_widget('entry_add_x')
        self.entry_add_y = xml.get_widget('entry_add_y')

        self.entry_x_error = xml.get_widget("entry_x_error")
        self.entry_y_error = xml.get_widget("entry_y_error")
        self.checkbutton_logX = xml.get_widget('checkbutton_logX')
        self.checkbutton_logY = xml.get_widget('checkbutton_logY')
        self.checkButtonPlotOnlySelected = xml.get_widget('checkButtonPlotOnlySelected')
        self.entry_x_column = xml.get_widget('entry_x_column')
        self.entry_y_column = xml.get_widget('entry_y_column')
        
        self.entry_filters = xml.get_widget("entry_filters")
        #self.checkbutton_histLogX = xml.get_widget('checkbutton_histLogX')
        #self.checkbutton_histLogY = xml.get_widget('checkbutton_histLogY')
        
        self.entry_hist_column = xml.get_widget('entry_hist_column')
        self.entry_no_of_bins = xml.get_widget('entry_no_of_bins')
        self.entry_plot_title = xml.get_widget('entry_plot_title')
        self.entry_plot_title.set_text(self.plot_title)
        
        self.filechooserdialog_save = xml.get_widget("filechooserdialog_save")
        self.filechooserdialog_save.connect("delete_event", yh_gnome.subwindow_hide)
        
        self.entry_sampling_probability = xml.get_widget("entry_sampling_probability")
        self.filechooserdialog_open = xml.get_widget("filechooserdialog_open")
        self.filechooserdialog_open.connect("delete_event", yh_gnome.subwindow_hide)
        
        self.app1_appbar1 = xml.get_widget('app1_appbar1')
        self.app1_appbar1.push('Status Message.')	#import gnome.ui has to be executed.
        
        self.treeview_matrix.connect('cursor-changed', self.update_no_of_selected, self.app1_appbar1)
        self.app1.show_all()
        
        self.xValuePreProcessor = None
        self.yValuePreProcessor = None
        
        self.x_error_column_index = None
        self.y_error_column_index = None
        
        self.typeName2PythonType = {
                "str": str,
                "string": str,
                "numeric":float,
                "number":float,
                "double":float,
                "float":float,
                "integer":int,
                "int":int}
Exemplo n.º 54
0
    try:
        import gnome
    except ImportError, e:
        exit_with_error('Importing gnome module failed',  err)

    try:
        import gconf
    except ImportError, e:
        exit_with_error('Importing gconf module failed',  err)


    import specimen.config as config

    gettext.bindtextdomain(config.PACKAGE, config.LOCALEDIR)
    gettext.textdomain(config.PACKAGE)
    gtk.glade.bindtextdomain(config.PACKAGE, config.LOCALEDIR)
    gtk.glade.textdomain(config.PACKAGE)

    prog = gnome.program_init(config.PACKAGE, config.VERSION)

    gtk.window_set_default_icon_name('gnome-specimen')

    from specimenwindow import SpecimenWindow
    w = SpecimenWindow()
    try:
        gtk.main ()
    except (KeyboardInterrupt):
        pass