本文整理汇总了Python中dexy.wrapper.Wrapper.setup_config方法的典型用法代码示例。如果您正苦于以下问题:Python Wrapper.setup_config方法的具体用法?Python Wrapper.setup_config怎么用?Python Wrapper.setup_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dexy.wrapper.Wrapper
的用法示例。
在下文中一共展示了Wrapper.setup_config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dexy_command
# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import setup_config [as 别名]
def dexy_command(
artifactsdir=Wrapper.DEFAULT_ARTIFACTS_DIR, # location of directory in which to store artifacts
conf=Wrapper.DEFAULT_CONFIG_FILE, # name to use for configuration file
danger=False, # whether to allow running remote files
dbalias=Wrapper.DEFAULT_DB_ALIAS, # type of database to use
dbfile=Wrapper.DEFAULT_DB_FILE, # name of the database file (it lives in the logs dir)
# directory=".", # the directory to process, you can just process a subdirectory of your project
disabletests=False, # Whether to disable the dexy 'test' filter
dryrun=Wrapper.DEFAULT_DRYRUN, # if True, just parse config and print batch info, don't run dexy
exclude=Wrapper.DEFAULT_EXCLUDE, # directories to exclude from dexy processing
globals=Wrapper.DEFAULT_GLOBALS, # global values to make available within dexy documents, should be KEY=VALUE pairs separated by spaces
help=False, # for people who type -help out of habit
h=False, # for people who type -h out of habit
hashfunction=Wrapper.DEFAULT_HASHFUNCTION, # What hash function to use, set to crc32 or adler32 for more speed but less reliability
ignore=Wrapper.DEFAULT_IGNORE_NONZERO_EXIT, # whether to ignore nonzero exit status or raise an error - may not be supported by all filters
logfile=Wrapper.DEFAULT_LOG_FILE, # name of log file
logformat=Wrapper.DEFAULT_LOG_FORMAT, # format of log entries
loglevel=Wrapper.DEFAULT_LOG_LEVEL, # log level
logsdir=Wrapper.DEFAULT_LOG_DIR, # location of directory in which to store logs
nocache=Wrapper.DEFAULT_DONT_USE_CACHE, # whether to force artifacts to run even if there is a matching file in the cache
# output=False, # Shortcut to mean "I just want the OutputReporter, nothing else"
recurse=Wrapper.DEFAULT_RECURSE, # whether to recurse into subdirectories when running Dexy
reports=Wrapper.DEFAULT_REPORTS, # reports to be run after dexy runs, enclose in quotes and separate with spaces
# reset=False, # whether to purge existing artifacts and logs before running Dexy
# run="", # specific document to run. if specified, this document + its dependencies will be all that is run
silent=False, # Whether to not print any output when running dexy
# uselocals=True, # use cached local copies of remote URLs, faster but might not be up to date, 304 from server will override this setting
version=False # For people who type -version out of habit
):
"""
Runs Dexy, by processing your .dexy configuration file and running content
through the filters you have specified. Results are cached in the
artifacts/ directory but are presented in a more usable format by
reporters. Basic reports are run automatically but you can specify
additional reports. Type 'dexy reporters' for a list of available reporters.
If your project is large, then running reports will start to take up a lot
of time, so you should specify only the reports you really need. You can
always run more reports after a batch has finished running (you can run
historical reports as far back as the last time you cleared out your
artifacts cache with a 'dexy reset' or similar).
After running Dexy, the output/ directory will hold what dexy thinks are
the most important generated files (with pretty filenames), the output-long
directory will hold all of your generated files (with ugly filenames), and
the logs/ directory will hold the basic dexy.log logfile and also a more
colorful and descriptive HTML log file in logs/run-latest/. Please look at
these logfiles to learn more about how dexy works, and if you run into
problems the dexy.log file might provide clues as to what has gone wrong.
Your original files will be copied to logs/source-batch-00001/ by the
SourceReporter (enabled by default). Each time you run dexy, your source
code files will be copied so you have a mini-version history. (You can also
use the 'dexy history' command to get a history for a given file, and you
can run the SourceReporter again at any time to restore a given batch's
source files.)
If you run into trouble, visit http://dexy.it/help
"""
if h or help:
help_command()
elif version:
version_command()
else:
wrapper = Wrapper(**locals())
import time
start_time = time.time()
try:
wrapper.setup_config()
wrapper.run()
wrapper.report()
print "finished in %0.4f" % (time.time() - start_time)
except dexy.exceptions.UserFeedback as e:
wrapper.cleanup_partial_run()
sys.stderr.write(e.message)
if not e.message.endswith("\n"):
sys.stderr.write("\n")
sys.stderr.write("Dexy is stopping.\n")
sys.exit(1)