當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。