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


Python settings.load函数代码示例

本文整理汇总了Python中settings.load函数的典型用法代码示例。如果您正苦于以下问题:Python load函数的具体用法?Python load怎么用?Python load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: startup

def startup():

	settings.load('settings.ini')

	db.setup()

	logging.getLogger().info("Checking database integrity.")
	#db.connection.execute("VACUUM")
	logging.getLogger().info("Integrity check complete. Continuing.")
开发者ID:gabrielbaez,项目名称:omniverse,代码行数:9,代码来源:omniverse.py

示例2: finish

	def finish(self):
		newres = not self.resbuttons.buttonmap[settings.size].selected
		newwin = not self.wbuttons.buttonmap[settings.fullscreen].selected
		for buttonset in self.buttonsets:
			for button in buttonset.buttons:
				if button.selected:
					button.confirm()
		context.pop()
		settings.save()
		settings.load()
		if newres or newwin:
			vista.init()
开发者ID:pombredanne,项目名称:Obb,代码行数:12,代码来源:menu.py

示例3: load

def load():
    print "main.load"
    settings.load()
    window = mc.GetActiveWindow()
    window.GetControl(1).SetVisible(False)
    focus_control = __restore_menu(window, __menu)
    if focus_control:
        print "SETTING focus in LOAD"
        focus(focus_control)
    else:
        __set_title('Main')
        window.GetList(MAIN_LIST_ID).SetVisible(True)
    window.GetControl(1).SetVisible(True)
开发者ID:rlf,项目名称:icefilms-boxee,代码行数:13,代码来源:main.py

示例4: main

def main():
	#start the game running
	try:
		# poke_types.load_data() #load pokemon type data
		# pokemon.load_data()
		map.load_data()
		settings.load(g)
		g.save = savegame.SaveGame(g) #initialize a new savegame manager
		g.reset() #reset the game
		g.mainloop() #start the main loop
	except error.QuitException: #if it was just a forced quit
		pass
	except Exception as e: #if it's any other exception
		error.exception_handler(g, e) #pass it to exception handler
	g.keeprunning = False
开发者ID:vinyldarkscratch,项目名称:peltengine,代码行数:15,代码来源:main.py

示例5: set_properties

    def set_properties(self):
        # Load the settings
        settings = Settings()
        settings.load()

        # Get the checkboxes
        x11_forward = self.builder.get_object("chk_enable_x11")
        request_compression = self.builder.get_object("chk_request_compress")
        force_ipv4 = self.builder.get_object("radio_force_ipv4")
        force_ipv6 = self.builder.get_object("radio_force_ipv6")

        # Set the config
        x11_forward.set_active(bool(settings.x11_forward))
        request_compression.set_active(bool(settings.request_compression))
        force_ipv4.set_active(bool(settings.force_ipv4))
        force_ipv6.set_active(bool(settings.force_ipv6))
开发者ID:vitorluis,项目名称:SSHClient,代码行数:16,代码来源:settings_window.py

示例6: _set_subs_lang

 def _set_subs_lang(self, subs):
   if subs is not None:
     sub_settings = settings.load("subtitles")
     if 'lang' in sub_settings:
       subs['lang'] = sub_settings['lang']
     else:
       subs['lang'] = 'eng'
   return subs
开发者ID:SalvatoreT,项目名称:blissflixx,代码行数:8,代码来源:__init__.py

示例7: _set_subs_lang

 def _set_subs_lang(self, subs):
     if subs is not None:
         sub_settings = settings.load("subtitles")
         if "lang" in sub_settings:
             subs["lang"] = sub_settings["lang"]
         else:
             subs["lang"] = "eng"
     return subs
开发者ID:riccardost,项目名称:blissflixx,代码行数:8,代码来源:__init__.py

示例8: _refresh

 def _refresh(self):
   channels = []
   cpaths =  glob.glob(path.join(locations.CHAN_PATH, CHANID_GLOB))
   for p in cpaths:
     channels.append(Channel(p, False))
   cpaths =  glob.glob(path.join(locations.PLUGIN_PATH, CHANID_GLOB))
   for p in cpaths:
     channels.append(Channel(p, True))
   self.channels = sorted(channels, key=lambda chan: chan.getTitle().upper())
   self.settings = settings.load("channels")
开发者ID:Kornflexx,项目名称:blissflixx,代码行数:10,代码来源:channels.py

示例9: getpath

    def getpath(force_select=False):
        filename = settings.load().get("tzpath", "")
        if not filename or force_select:
            FILE_OPTS = ___ = dict()
            ___["title"] = u"Locate the 桶裝出貨表 file."
            ___["defaultextension"] = ".xls"
            ___["filetypes"] = [("Excel files", ".xls"), ("all files", ".*")]
            ___["initialdir"] = u"T:\\Users\\chairman\\Documents\\"
            ___["initialfile"] = u"桶裝出貨表.xls"
            filename = os.path.normpath(tkFileDialog.askopenfilename(**FILE_OPTS))

            settings.update(tzpath=filename)
        return filename
开发者ID:Ripley6811,项目名称:TAIMAU,代码行数:13,代码来源:print_labels.py

示例10: _refresh

 def _refresh(self):
   channels = []
   cpaths =  glob.glob(path.join(locations.CHAN_PATH, CHANID_GLOB))
   for p in cpaths:
     try: 
       channels.append(Channel(p, False))
     except ImportError:
       pass
   cpaths =  glob.glob(path.join(locations.PLUGIN_PATH, CHANID_GLOB))
   for p in cpaths:
     try: 
       channels.append(Channel(p, True))
     except ImportError:
       pass
   # Ignore channels with no image
   channels = filter(lambda chan: chan.imageExists(), channels)
   self.channels = sorted(channels, key=lambda chan: chan.getTitle().upper())
   self.settings = settings.load("channels")
开发者ID:crow34,项目名称:vhsheaven,代码行数:18,代码来源:channels.py

示例11: int

-si, --splitinto: number of files the source archive should be split into. If not specified, the number of files is
                    determined based on the archive rows limit config value
-c, --clear: delete all files from the archives directory before splitting
-v, --verbose: verbose mode
"""

import argparse
import os
import sys

sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../../../lib')))
from plugins.ucnk_conc_persistence3 import ArchMan
import settings

conf_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '../../../../conf/config.xml'))
settings.load(conf_path)
plugin_conf = settings.get('plugins', 'conc_persistence3')
db_path = plugin_conf.get('ucnk:archive_db_path')
rows_limit = int(plugin_conf.get('ucnk:archive_rows_limit'))
arch_man = ArchMan(db_path, rows_limit)

parser = argparse.ArgumentParser()
parser.add_argument("source_archive", help="full path to the source archive db file")
parser.add_argument("-si", "--splitinto", help="number of files the source archive should be split into")
parser.add_argument("-c", "--clear", action="store_true", help="clear the archives directory before splitting")
parser.add_argument("-v", "--verbose", action="store_true", help="verbose mode")

args = parser.parse_args()
source_path = args.source_archive

if not os.path.exists(source_path):
开发者ID:tomachalek,项目名称:kontext,代码行数:31,代码来源:importarch.py

示例12: quit

#!/usr/bin/python
from settings import load
from experiment import ExperimentSet
import traceback, sys, os

if __name__ == "__main__":
    # Read arguments
    try:
        settingsfile = sys.argv[1]
        print "Settings file: " + settingsfile
    except IndexError:
        print "Bad parameters, should be 'python engine.py settingsfile'"
        quit()

    # Generate variables
    settings = load(settingsfile)

    # Create and run the experiment
    experiments = ExperimentSet(settings)
    experiments.run()
    
    print "Experiments concluded :)"
开发者ID:kazagistar,项目名称:rpsim,代码行数:22,代码来源:engine.py

示例13: handleKnownUser

import action
import user
import iptv

#####################################################################
# Prerequisites                                                     #
#####################################################################

settings_file = '.settings.conf'
users_file = '.users.json'
handlers_dir = 'actions/'

# Table for global data storing
public = table.Table()
# Load settings
config = settings.load(settings_file)
# Load users list
users = user.UserStore(users_file)
# Load action handlers
actions = action.ActionStore()
actions.load(handlers_dir)

#####################################################################
# XMPP specific methods                                             #
#####################################################################

def handleKnownUser(connection, message, params):
    data = params.data
    user = params.self

    handler, match = actions.select(data, user.access or 0)
开发者ID:edzius,项目名称:fire-bot,代码行数:31,代码来源:firebot.py

示例14: controller_class

            controller_class = self.load_controller_class(environ['PATH_INFO'])
            app = controller_class(request=request, ui_lang=ui_lang)
            status, headers, sid_is_valid, body = app.run()
        response = Response(response=body, status=status, headers=headers)
        if not sid_is_valid:
            curr_data = dict(request.session)
            request.session = sessions.new()
            request.session.update(curr_data)
            request.session.modified = True
        if request.session.should_save:
            sessions.save(request.session)
            response.set_cookie(sessions.get_cookie_name(), request.session.sid)
        return response(environ, start_response)


settings.load(path=CONF_PATH)

if settings.get('global', 'manatee_path', None):
    sys.path.insert(0, settings.get('global', 'manatee_path'))

# please note that some environments may provide umask setting themselves
if settings.get('global', 'umask', None):
    os.umask(int(settings.get('global', 'umask'), 8))

if not settings.get_bool('global', 'maintenance'):
    application = KonTextWsgiApp()
else:
    application = MaintenanceWsgiApp()

robots_path = os.path.join(os.path.dirname(__file__), 'files/robots.txt')
if os.path.isfile(robots_path):
开发者ID:tomachalek,项目名称:kontext,代码行数:31,代码来源:app.py

示例15: get_db

import settings


def get_db(conf):
    return redis.StrictRedis(host=conf['default:host'], port=int(conf['default:port']), db=int(conf['default:id']))


if __name__ == '__main__':
    import argparse

    argparser = argparse.ArgumentParser(description="RedisDB clean-up utility")
    argparser.add_argument('clean_what', metavar="ACTION", help="what item group should be cleaned (session, concordance)")

    args = argparser.parse_args()
    patterns = {
        'session': 'session:*',
        'concordance': 'concordance:*'
    }

    if not args.clean_what in patterns:
        raise ValueError('Unknown action: %s' % args.clean_what)

    settings.load('%s/conf/config.xml' % app_path)
    db = get_db(settings.get('plugins', 'db'))
    keys = db.keys(patterns[args.clean_what])
    i = 0
    for key in keys:
        db.delete(key)
        print('deleted: %s' % key)
        i += 1
    print('Finished deleting %d keys' % i)
开发者ID:anukat2015,项目名称:kontext,代码行数:31,代码来源:cleanup.py


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