本文整理汇总了Python中settings.load函数的典型用法代码示例。如果您正苦于以下问题:Python load函数的具体用法?Python load怎么用?Python load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: print
# Title: main.py
# this is the main file of exectuion
# import file # imaginary import modeling code directly after perl version
import project
import settings # imginary import of settings
import os;
from languageDir import *; # import all language parsers.
import lang;
#import topics
#import builder
if __name__ == "__main__": # start point of python interpeter.
args = settings.load();
# languages.load();
# topics.load();
# project.loadConfigFileInfo();
# print 'starting normal_docs'
oldTimes = project.getOldFileTimes(args);
curTimes = project.getCurrentFileTimes(args);
ParseList = project.cmpFileTimes(curTimes,oldTimes);
project.updateModTimes(curTimes,args);
print("now filtering the ParseList");
project.filterParseList(ParseList);
print ParseList;
for sourceFile in ParseList:
lang_parser = lang.langRegister().languageOf(sourceFile);
lang_parser.ParseFile(sourceFile);
开发者ID:warlord500,项目名称:nat_doc_py,代码行数:30,代码来源:main.py
示例17: additional
parser.add_argument('-d', '--data-only', metavar='DATA_ONLY', action='store_const', const=True)
parser.add_argument('-c', '--create-if-none', metavar='CREATE_IF_NONE',
action='store_const', const=True)
parser.add_argument('-j', '--json-out', metavar='JSON_OUT', type=str,
help='A directory where corpus installation JSON should be stored')
parser.add_argument('-r', '--reg-path', type=str, default='',
help='Path to registry files')
parser.add_argument('-a', '--variant', type=str,
help='Try to search for alternative registry in a directory with this name')
parser.add_argument('-v', '--verbose', action='store_const', const=True,
help='Print some additional (error) information')
parser.add_argument('-y', '--dry-run', action='store_const', const=True,
help='No actual database operation will be performed. SQL queries will be printed.')
args = parser.parse_args()
import settings
settings.load(args.conf_path)
if args.dry_run:
db = DummySQL()
else:
db = MySQL(MySQLConf(settings))
if args.schema_only:
prepare_tables(db)
else:
reg_path = args.reg_path if args.reg_path else settings.get('corpora', 'manatee_registry')
shared = DummyShared() if args.dry_run else Shared(reg_path=reg_path)
ijson = InstallJsonDir(args.json_out)
parse_corplist(path=args.corplist, db=db, shared=shared, json_out=ijson,
variant=args.variant, verbose=args.verbose, data_only=args.data_only,
create_if_none=args.create_if_none)
ijson.write()
db.commit()
开发者ID:czcorpus,项目名称:kontext,代码行数:31,代码来源:install.py
示例18: RuntimeError
import os, sys, ConfigParser, logging, signal, string, time
from daemon import runner
working_directory = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(1, working_directory + '/classes')
sys.path.insert(1, working_directory + '/lib')
import settings
from irc import *
from blockupdate import *
from commands import *
# Load our local configuration
config = ConfigParser.RawConfigParser()
if not config.read(working_directory + '/conf/config.cfg'):
raise RuntimeError('Failed to load configuration: conf/config.cfg')
settings = settings.load(config)
# Ensure some paths exist
logfile = working_directory + '/' + config.get('Logging', 'file')
if not os.path.exists(os.path.dirname(logfile)):
os.makedirs(os.path.dirname(logfile))
# Setup logging according to configuration
numeric_level = getattr(logging, config.get('Logging', 'level').upper(), None)
formatter = config.get('Logging', 'format')
if not isinstance(numeric_level, int):
raise ValueError('Invalid log level: %s' % config.get('Logging', 'level'))
logging.basicConfig(format=formatter, level=numeric_level)
logFormatter = logging.Formatter(formatter)
logger = logging.getLogger('bot')
fh = logging.FileHandler(logfile)
开发者ID:FoxCoinDev,项目名称:mpos-bot,代码行数:31,代码来源:ejgithub.py
示例19:
import sys
import time
try:
import cPickle as pickle
except ImportError:
import pickle
CURR_PATH = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, '%s/lib' % CURR_PATH)
import settings
import initializer
import plugins
import translation
from bgcalc.stderr2f import stderr_redirector
settings.load('%s/conf/config.xml' % CURR_PATH)
if settings.get('global', 'manatee_path', None):
sys.path.insert(0, settings.get('global', 'manatee_path'))
import manatee
os.environ['MANATEE_REGISTRY'] = settings.get('corpora', 'manatee_registry')
initializer.init_plugin('db')
initializer.init_plugin('sessions')
initializer.init_plugin('auth')
initializer.init_plugin('conc_cache')
initializer.init_plugin('query_storage')
initializer.init_plugin('conc_persistence')
initializer.init_plugin('sessions')
initializer.init_plugin('user_items')
initializer.init_plugin('corparch')
initializer.init_plugin('live_attributes', optional=True)
开发者ID:tomachalek,项目名称:kontext,代码行数:31,代码来源:worker.py
示例20: codi_sortida
ERROR = "ERROR"
SUCCESS = "SUCCESS"
SKIP = "SKIP"
REJECT = "REJECT"
UNKNOWN = "UNKNOWN"
def codi_sortida(estat):
return (0 if estat == SUCCESS or estat == SKIP else 1)
if __name__ == '__main__':
a = None
opts, args = getopt.getopt(sys.argv[1:], 'c:')
for o, a in opts:
if o == '-c':
settings.load(a)
logging.basicConfig(
filename=settings.get("log_file"),
level=settings.get("log_level"),
format='%(asctime)s [%(process)d] %(name)-12s'
' %(levelname)-8s %(message)s'
)
buffer_logs = StringIO()
logger.addHandler(logging.StreamHandler(buffer_logs))
if a is not None:
logger.info("Fitxer de configuracio [%s]", a)
estat = UNKNOWN
开发者ID:aaguilera,项目名称:mailtoticket,代码行数:31,代码来源:mailtoticket.py
注:本文中的settings.load函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论