本文整理匯總了Python中gobject.GObject方法的典型用法代碼示例。如果您正苦於以下問題:Python gobject.GObject方法的具體用法?Python gobject.GObject怎麽用?Python gobject.GObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gobject
的用法示例。
在下文中一共展示了gobject.GObject方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import GObject [as 別名]
def __init__(self, config_file, default_config=None):
'''
Init config module.
@param config_file: Config filepath.
@param default_config: Default config value use when config file is empty.
'''
gobject.GObject.__init__(self)
self.config_parser = ConfigParser()
self.remove_option = self.config_parser.remove_option
self.has_option = self.config_parser.has_option
self.add_section = self.config_parser.add_section
self.getboolean = self.config_parser.getboolean
self.getint = self.config_parser.getint
self.getfloat = self.config_parser.getfloat
self.options = self.config_parser.options
self.items = self.config_parser.items
self.config_file = config_file
self.default_config = default_config
# Load default configure.
self.load_default()
示例2: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import GObject [as 別名]
def __init__(self):
gobject.GObject.__init__(self)
self.__gconfDir = "/apps/gedit-2/plugins/intelligent_text_completion"
# default values
self.closeBracketsAndQuotes = True
self.completeXML = True
self.detectLists = True
self.autoindentAfterFunctionOrList = True
# create gconf directory if not set yet
client = gconf.client_get_default()
if not client.dir_exists(self.__gconfDir):
client.add_dir(self.__gconfDir,gconf.CLIENT_PRELOAD_NONE)
if client.dir_exists(self.__gconfDir+"/closeBracketsAndQuotes"):
# get the gconf keys, or stay with default if key not set
try:
self.closeBracketsAndQuotes = client.get_bool(self.__gconfDir+"/closeBracketsAndQuotes")
self.completeXML = client.get_bool(self.__gconfDir+"/completeXML")
self.detectLists = client.get_bool(self.__gconfDir+"/detectLists")
self.autoindentAfterFunctionOrList = client.get_bool(self.__gconfDir+"/autoindentAfterFunctionOrList")
except Exception, e: # catch, just in case
print e
示例3: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import GObject [as 別名]
def __init__(self, monitor):
gobject.GObject.__init__(self)
self._setup_observer(monitor)
示例4: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import GObject [as 別名]
def __init__(self):
gobject.GObject.__init__(self)
self._show = True
self._antialias = True
示例5: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import GObject [as 別名]
def __init__(self, min_queue_time=10):
gobject.GObject.__init__(self)
self.min_queue_time = min_queue_time
self.is_runnning = False
self.status = self.PAUSED
self.video_container = None
示例6: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import GObject [as 別名]
def __init__(self, period=0.5, alpha=0.5):
gobject.GObject.__init__(self)
self.period = period
self.alpha = alpha
self.last_t = 0.0
self.last_data = 0
self.rate = 0.0
self.rate_filt = -1
self.horizon = 5
self.rate_vec = CircularBuffer(self.horizon)
self.running = False
self.calc_iteration_id = None
示例7: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import GObject [as 別名]
def __init__(self, url):
gobject.GObject.__init__(self)
#
debug(DEBUG+1, '%s init %s', self, url)
self.url = url
self.host, self.port, self.path = parse_url(url)
self.client = None
self.connector = reactor.connectTCP(self.host, self.port, self)