本文整理汇总了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)
示例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
示例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', '/'))
示例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)
示例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 = {}
示例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()
示例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()