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


Python KApplication.__init__方法代码示例

本文整理汇总了Python中kdecore.KApplication.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.__init__方法的具体用法?Python KApplication.__init__怎么用?Python KApplication.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kdecore.KApplication的用法示例。


在下文中一共展示了KApplication.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import __init__ [as 别名]
 def __init__(self, *args):
     KApplication.__init__(self)
     cfg = BaseConfig()
     self.cfg = cfg
     dirs = KStandardDirs()
     self.tmpdir = str(dirs.findResourceDir('tmp', '/'))
     self.datadir = str(dirs.findResourceDir('data', '/'))
     self.socketdir = str(dirs.findResourceDir('socket', '/'))
     dsn = {}
     self.cfg.setGroup('database')
     dsn['user'] = self.cfg.readEntry('dbuser')
     dsn['dbname'] = self.cfg.readEntry('dbname')
     dsn['passwd'] = self.cfg.readEntry('dbpass')
     self.cfg.setGroup('pgpool')
     self.pgpool = None
     usepgpool = self.cfg.readEntry('usepgpool')
     if usepgpool != 'false':
         print 'using pgpool'
         self.pgpool = PgPool(self.cfg, self.tmpdir, self.datadir)
         if not os.path.isfile(self.pgpool.pidfile):
             self.pgpool.run()
         else:
             self.pgpool = None
         dsn['host'] = 'localhost'
         dsn['port'] = self.cfg.readEntry('port')
     else:
         self.cfg.setGroup('database')
         dsn['host'] = self.cfg.readEntry('dbhost')
         dsn['port'] = self.cfg.readEntry('dbport')
     self.db = BaseDatabase(dsn, 'Konsultant', self)
     self.db.app = self
     self.connect(self, SIGNAL('aboutToQuit()'), self.quit)
开发者ID:BackupTheBerlios,项目名称:konsultant-svn,代码行数:34,代码来源:main.py

示例2: __init__

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import __init__ [as 别名]
    def __init__(self):
        KApplication.__init__(self)
        # in case something needs done before quitting
        self.connect(self, SIGNAL('aboutToQuit()'), self.quit)
        self.dcop = ToolBoxDCOPInterface()
        self._setup_standard_directories()
        #self._generate_data_directories()
        dbfile = os.path.join(self.datadir, 'main.db')
        #self.conn = Connection(dbname=dbfile, autocommit=True,
        #                       encoding='ascii')
        #self.guests = Guests(self.conn)
        #self.db = EntityManager(self.conn)
        from sqlalchemy import create_engine
        from sqlalchemy.orm import sessionmaker
        self.engine = create_engine('sqlite:///%s' % dbfile)
        if not self.engine.table_names():
            from newschema import metadata
            metadata.create_all(self.engine)
        self.DbSession = sessionmaker(bind=self.engine,
                                      autoflush=True, transactional=False)
        self.session = self.DbSession()
        self.db = EntityManager(self.session)
        
        self.urlhandler = MainUrlHandler(self)
        self.filehandler = BaseFileHandler(self)
        
        # setup the timer to handle background jobs
        self.timer = QTimer()
        # every five seconds
        self.timer.changeInterval(1000)
        self.connect(self.timer, SIGNAL('timeout()'), self._timer_done)

        self.main_window = None
开发者ID:BackupTheBerlios,项目名称:useless-svn,代码行数:35,代码来源:application.py

示例3: __init__

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import __init__ [as 别名]
 def __init__(self):
     KApplication.__init__(self)
     self.set_config()
     self.conn = None
     dirs = KStandardDirs()
     self.tmpdir = str(dirs.findResourceDir('tmp', '/'))
     self.datadir = str(dirs.findResourceDir('data', '/'))
     # I probably don't need the socket dir
     self.socketdir = str(dirs.findResourceDir('socket', '/'))
开发者ID:joelsefus,项目名称:paella,代码行数:11,代码来源:application.py

示例4: __init__

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import __init__ [as 别名]
 def __init__(self):
     KApplication.__init__(self)
     # in case something needs done before quitting
     self.connect(self, SIGNAL('aboutToQuit()'), self.quit)
     self._setup_standard_directories()
     #self._generate_data_directories()
     dbfile = os.path.join(self.datadir, 'guests.db')
     self.conn = Connection(dbname=dbfile, autocommit=True,
                            encoding='ascii')
     self.guests = Guests(self.conn)
开发者ID:BackupTheBerlios,项目名称:useless-svn,代码行数:12,代码来源:utapp.py

示例5: __init__

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import __init__ [as 别名]
 def __init__(self, *args):
     KApplication.__init__(self)
     self.cfg = PaellaConfig()
     self.conn = PaellaConnection(self.cfg)
     self.db = BaseDatabase(self.conn, 'paelladb', None)
     dirs = KStandardDirs()
     self.tmpdir = str(dirs.findResourceDir('tmp', '/'))
     self.datadir = str(dirs.findResourceDir('data', '/'))
     self.socketdir = str(dirs.findResourceDir('socket', '/'))
     dsn = {}
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:12,代码来源:main.py

示例6: __init__

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import __init__ [as 别名]
 def __init__(self):
     KApplication.__init__(self)
     # in case something needs done before quitting
     self.connect(self, SIGNAL('aboutToQuit()'), self.quit)
     # place dcop object here
     self.dcop = DosboxHandler()
     self._setup_standard_directories()
     self._generate_data_directories()
     self.mainconfigfilename = os.path.join(self.datadir, 'dosbox-pykde.conf')
     if os.path.isfile(self.mainconfigfilename):
         self.generate_default_config()
         self.generate_main_objects()
开发者ID:umeboshi2,项目名称:lilali,代码行数:14,代码来源:application.py

示例7: __init__

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import __init__ [as 别名]
 def __init__(self):
     KApplication.__init__(self)
     self.conn = PaellaConnection()
     self.umlcfg = UmlConfig()
     self.update_config()
开发者ID:umeboshi2,项目名称:paella,代码行数:7,代码来源:main.py


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