本文整理汇总了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)