コード例 #1
0
ファイル: __init__.py プロジェクト: binyuj/deepin-talk
def init_common_db():
    global common_db_init_finished
    f = get_config_path("common_{0}.db".format(COMMON_DB_VERSION))    
    common_db.init(f)
    created = False
    if not os.path.exists(f):
        created = True
        common_db.connect()
        create_common_tables()
        
    common_db_init_finished = True    
    signals.db_init_finished.send(sender=common_db, created=created)    
コード例 #2
0
ファイル: __init__.py プロジェクト: disda/deepin-talk
def init_common_db():
    global common_db_init_finished
    f = get_config_path("common_{0}.db".format(COMMON_DB_VERSION))
    common_db.init(f)
    created = False
    if not os.path.exists(f):
        created = True
        common_db.connect()
        create_common_tables()

    common_db_init_finished = True
    signals.db_init_finished.send(sender=common_db, created=created)
コード例 #3
0
ファイル: __init__.py プロジェクト: binyuj/deepin-talk
# 
# Author:     Hou ShaoHui <*****@*****.**>
# Maintainer: Hou ShaoHui <*****@*****.**>
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
from functools import partial
from dtalk.utils import xdg
# from dtalk.utils import pyini
from dtalk.conf.ini import NotifyIni

user_settings_file = xdg.get_config_path("settings.ini", check_exists=True)
settings = NotifyIni(os.path.join(xdg.get_parent_dir(__file__), "default_settings.ini"))
if user_settings_file:
    settings.read(filename=user_settings_file)
settings.write = partial(settings.save, filename=user_settings_file)

DEBUG = True
コード例 #4
0
ファイル: __init__.py プロジェクト: disda/deepin-talk
# Author:     Hou ShaoHui <*****@*****.**>
# Maintainer: Hou ShaoHui <*****@*****.**>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
from functools import partial
from dtalk.utils import xdg
# from dtalk.utils import pyini
from dtalk.conf.ini import NotifyIni

user_settings_file = xdg.get_config_path("settings.ini", check_exists=True)
settings = NotifyIni(
    os.path.join(xdg.get_parent_dir(__file__), "default_settings.ini"))
if user_settings_file:
    settings.read(filename=user_settings_file)
settings.write = partial(settings.save, filename=user_settings_file)

DEBUG = True