當前位置: 首頁>>代碼示例>>Python>>正文


Python gobject.GObject類代碼示例

本文整理匯總了Python中gobject.GObject的典型用法代碼示例。如果您正苦於以下問題:Python GObject類的具體用法?Python GObject怎麽用?Python GObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GObject類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 def __init__ (self, secs, gain, bsecs=-1, minutes=-1):
     GObject.__init__(self)
     
     if bsecs < 0: bsecs = secs
     if minutes < 0:
         minutes = secs / 60
     self.minutes = minutes  # The number of minutes for the original starting
         # time control (not necessarily where the game was resumed,
         # i.e. self.intervals[0][0])
     self.intervals = [[secs],[bsecs]]
     self.gain = gain
     
     self.paused = False
     # The left number of secconds at the time pause was turned on
     self.pauseInterval = 0
     self.counter = None
     
     self.started = False
     self.ended = False
     
     self.movingColor = WHITE
     
     self.connect('time_changed', self.__zerolistener, 'time_changed')
     self.connect('player_changed', self.__zerolistener, 'player_changed')
     self.connect('pause_changed', self.__zerolistener, 'pause_changed')
     self.heap = []
開發者ID:btrent,項目名稱:knave,代碼行數:26,代碼來源:TimeModel.py

示例2: __init__

	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from SmartSpace import SmartSpace
		SmartSpace(editor, self)
		from ConfigurationManager import Manager
		Manager(editor, self)
開發者ID:mystilleef,項目名稱:scribes,代碼行數:7,代碼來源:Manager.py

示例3: __init__

	def __init__(self, editor):
		GObject.__init__(self)
		self.__init_attributes(editor)
		from GUI.Manager import Manager
		Manager(self, editor)
		from Loader import Loader
		Loader(self, editor)
開發者ID:mystilleef,項目名稱:scribes,代碼行數:7,代碼來源:Manager.py

示例4: __init__

    def __init__(self, plugin, frame):
        GObject.__init__(self)
        PropertyObject.__init__(self)
        log.debug('Initializing FreezeFrame ' + frame)
        
        self.plugin = plugin 
        self._frame = frame
		
        self._pref_cbs = []
        self._app_cbs = []
        self._notebook_cbs = []
        self._queue_cbs = []
        self._obd_cbs = []
        
        if plugin.app.prefs.get('imperial', False):
            self._unit_standard = 'Imperial'
        else:
            self._unit_standard = 'Metric'
            
        cb_id = plugin.app.prefs.add_watch('imperial', 
                                    self._notify_units_cb)
        self._pref_cbs.append(('imperial', cb_id))
        
        self._setup_gui()
        self._setup_sensors()
        self._get_supported_pids()
開發者ID:benvm,項目名稱:garmon,代碼行數:26,代碼來源:freeze_frame_data.py

示例5: __init__

 def __init__(self, obd_device):
     """ @param obd_device: the OBDDevice to send commands
         @param timeout: the time between two commands
     """
     GObject.__init__(self)
     PropertyObject.__init__(self, obd_device=obd_device)
     self._queue = []
     self._os_queue = []
開發者ID:bwhitelock,項目名稱:garmon-ng,代碼行數:8,代碼來源:scheduler.py

示例6: __init__

	def __init__(self, manager, editor):
		GObject.__init__(self)
		self.__init_attributes(manager, editor)
		self.__signal_id_1 = self.__manager.connect("abbreviations-updated", self.__manager_abbreviations_updated_cb)
		self.__signal_id_2 = self.__manager.connect("destroy", self.__monitor_destroy_cb)
		self.__signal_id_3 = self.__editor.textview.connect("key-press-event", self.__monitor_key_press_event_cb)
		if self.__can_monitor is False:
			self.__editor.textview.handle_block(self.__signal_id_3)
開發者ID:mystilleef,項目名稱:scribes,代碼行數:8,代碼來源:Monitor.py

示例7: on_resource_load_finished

 def on_resource_load_finished(self, func, *args ):
     from gobject import GObject
     def WebView_C_Callable( _webview, _webframe, _webresource, data):
         from .webkit3__WebKitWebFrame import WebKitWebFrame
         from .webkit3__WebKitWebResource import WebKitWebResource
         func( self, self.get_main_frame(), WebKitWebResource(None, obj=_webresource), *args)#WebKitWebFrame(None,obj=_webframe), WebKitWebResource(None,obj=_webresource), *args)
         return None
     CFUNC = CFUNCTYPE(None, POINTER(c_int), POINTER(c_int), POINTER(c_int), POINTER(c_int))
     GObject.connect( self, 'resource-load-finished', func, *args, cfunc = (CFUNC(WebView_C_Callable),CFUNC))
開發者ID:jaykhopale,項目名稱:pywebkit3,代碼行數:9,代碼來源:webkit3__WebKitWebView.py

示例8: __init__

    def __init__(self, device):
        """ @param device: the OBDDevice to send commands
            @param timeout: the time between two commands
        """
        GObject.__init__(self)
        PropertyObject.__init__(self, device=device)
        self._queue = []

        self._working = False
開發者ID:benvm,項目名稱:garmon,代碼行數:9,代碼來源:command_queue.py

示例9: __init__

	def __init__(self):
		GObject.__init__(self)
		from IndexerProcessMonitor import Monitor
		Monitor(self)
		from DBusService import DBusService
		DBusService(self)
		from DictionaryGenerator import Generator
		Generator(self)
		from JobSpooler import Spooler
		Spooler(self)
開發者ID:baverman,項目名稱:scribes-goodies,代碼行數:10,代碼來源:IndexerManager.py

示例10: __init__

	def __init__(self, manager, editor):
		GObject.__init__(self)
		self.__init_attributes(manager, editor)
		self.__sigid1 = manager.connect("destroy", self.__destroy_cb)
		from DatabaseUpdater import Updater
		Updater(self, editor)
		from CheckButton import Button
		Button(self, editor)
		from DatabaseListener import Listener
		Listener(self, editor)
開發者ID:mystilleef,項目名稱:scribes,代碼行數:10,代碼來源:Manager.py

示例11: _attempt_connection

 def _attempt_connection(self, _backoff):
     self._disconnect_viewer()
     self._session = SpiceClientGtk.Session()
     self._session.set_property('password', self._password)
     self._session.set_property('enable-usbredir', False)
     # Ensure clipboard sharing is disabled
     self._gtk_session = SpiceClientGtk.spice_gtk_session_get(self._session)
     self._gtk_session.set_property('auto-clipboard', False)
     GObject.connect(self._session, 'channel-new', self._new_channel)
     self._session.open_fd(-1)
開發者ID:cmusatyalab,項目名稱:vmnetx,代碼行數:10,代碼來源:view.py

示例12: __init__

    def __init__(self, builder):
        GObject.__init__(self)
        PropertyObject.__init__(self)

        self._code_label = builder.get_object('code_label')
        self._class_label = builder.get_object('class_label')
        self._description_label = builder.get_object('description_label')
        self._additional_textview = builder.get_object('additional_textview')
    
        self._additional_buffer = gtk.TextBuffer()
        self._additional_textview.set_buffer(self._additional_buffer)
開發者ID:benvm,項目名稱:garmon,代碼行數:11,代碼來源:dtc_reader.py

示例13: __init__

    def __init__(self, glade):
        GObject.__init__(self)
        PropertyObject.__init__(self)

        self._code_label = glade.get_widget('code_label')
        self._class_label = glade.get_widget('class_label')
        self._description_label = glade.get_widget('description_label')
        self._additional_textview = glade.get_widget('additional_textview')
    
        self._additional_buffer = gtk.TextBuffer()
        self._additional_textview.set_buffer(self._additional_buffer)
開發者ID:bwhitelock,項目名稱:garmon-ng,代碼行數:11,代碼來源:dtc_reader.py

示例14: __init__

    def __init__(self, app):
        GObject.__init__(self)

        self.app = app
        self._config = ConfigParser()
        self._filename = os.path.join(save_config_path("garmon"), "config")
        self._config.read(self._filename)
        
        self._dialog = _PrefsDialog()
        
        self._watches = []
開發者ID:benvm,項目名稱:garmon,代碼行數:11,代碼來源:preferences.py

示例15: __init__

 def __init__ (self):
     GObject.__init__(self)
     
     self.engines = []
     
     self.jsonpath = addUserConfigPrefix("engines.json")
     try:
         self._engines = json.load(open(self.jsonpath))
     except ValueError, e:
         log.warn("engineNest: Couldn\'t read engines.json, renamed it to .bak\n%s\n" % (self.jsonpath,e))
         os.rename(self.jsonpath, self.jsonpath+".bak")
         self._engines = deepcopy(backup)
開發者ID:btrent,項目名稱:knave,代碼行數:12,代碼來源:engineNest.py


注:本文中的gobject.GObject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。