当前位置: 首页>>代码示例>>Python>>正文


Python gobject.GObject方法代码示例

本文整理汇总了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() 
开发者ID:dragondjf,项目名称:QMusic,代码行数:24,代码来源:config.py

示例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 
开发者ID:nymanjens,项目名称:gedit-intelligent-text-completion,代码行数:27,代码来源:intelligent_text_completion.py

示例3: __init__

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import GObject [as 别名]
def __init__(self, monitor):
        gobject.GObject.__init__(self)
        self._setup_observer(monitor) 
开发者ID:mbusb,项目名称:multibootusb,代码行数:5,代码来源:glib.py

示例4: __init__

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import GObject [as 别名]
def __init__(self):
        gobject.GObject.__init__(self)
        self._show = True
        self._antialias = True 
开发者ID:OpenXenManager,项目名称:openxenmanager,代码行数:6,代码来源:chart_object.py

示例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 
开发者ID:ldecicco,项目名称:tapas,代码行数:8,代码来源:BaseMediaEngine.py

示例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 
开发者ID:ldecicco,项目名称:tapas,代码行数:14,代码来源:util.py

示例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) 
开发者ID:ldecicco,项目名称:tapas,代码行数:10,代码来源:connection.py


注:本文中的gobject.GObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。