本文整理汇总了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 = []
示例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)
示例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)
示例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()
示例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 = []
示例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)
示例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))
示例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
示例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)
示例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)
示例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)
示例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)
示例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)
示例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 = []
示例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)