本文整理汇总了Python中setup.setup函数的典型用法代码示例。如果您正苦于以下问题:Python setup函数的具体用法?Python setup怎么用?Python setup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
def run(self):
import setup
_old_argv = _sys.argv
try:
_sys.argv = ["setup.py", "-q", "build"]
if not self.HIDDEN:
_sys.argv.remove("-q")
setup.setup()
if "java" not in _sys.platform.lower():
_sys.argv = [
"setup.py",
"-q",
"install_lib",
"--install-dir",
shell.native(self.dirs["lib"]),
"--optimize",
"2",
]
if not self.HIDDEN:
_sys.argv.remove("-q")
setup.setup()
finally:
_sys.argv = _old_argv
for name in shell.files("%s/tdi" % self.dirs["lib"], "*.py"):
self.compile(name)
term.write("%(ERASE)s")
term.green("All files successfully compiled.")
示例2: commandstart
def commandstart():
print(coinlist[0])
setup(appdirpath, appdatfile, appdatadirpath, appdata, snpy, coinlist, exenames)
coincontroller = Coincontroller(coinlist, rpcports)
startcoinservers(coincontroller, exenames, envars, startupstatcheckfreqscnds, appdata)
conn = coincontroller
paramslist['getsynctime'] = conn
# appfilemakeifno()
while True:
uinput = str(input('$$')).split()
if len(uinput) > 0:
if uinput[0].lower() in listcommands:
if len(uinput) > 1:
if uinput[0].lower() in paramslist:
globals()[str('command' + uinput[0].lower())](paramslist[uinput[0]](uinput[1].lower()))
#globals()[str('command' + uinput[0].lower())](uinput[1].lower())
else:
print('\"' + uinput[1] + '\"' + ', is not a valid parameter. Type help for a list of available commands and parameters wrapped with bracket example: getsynctime [coin] is typed:/ngetsynctime turbostake')
else:
globals()[str('command' + uinput[0].lower())]()
else:
print('\"' + uinput[0] + '\"' + ', is not a valid command. Type help for a list of available commands.')
else:
print('invalid command. Type help for a list of available commands.')
示例3: exec_command
def exec_command(cluster, run, command, **kwargs):
log.info('exec_command: {0}'.format(command))
action = command.split(' ', 1)
result = 0
if action[0] == 'sh':
result = cmd(action[1])[0]
elif action[0] == 'create':
env.is_local = True
env.host = 'localhost'
container.create(cluster[action[1]])
env.is_local = False
elif action[0] == 'delete':
env.is_local = True
env.host = 'localhost'
container.delete(cluster[action[1]])
env.is_local = False
elif action[0] == 'setup':
env.runs = [run]
env.user = CONF.job_user
env.password = CONF.job_password
CONF.user = CONF.job_user
CONF.password = CONF.job_password
setup(**kwargs)
elif action[0] == 'manage':
env.runs = [run]
env.user = CONF.job_user
env.password = CONF.job_password
CONF.user = CONF.job_user
CONF.password = CONF.job_password
manage(action[1], **kwargs)
log.info('result_command: {0}({1})'.format(command, result))
return result
示例4: __init__
def __init__(self):
logutils.setup_logging("mustikkabot")
self.log = logging.getLogger("mustikkabot")
self.basepath = tools.find_basepath()
self.confdir = os.path.join(self.basepath, "config")
self.datadir = os.path.join(self.basepath, "data")
self.srcdir = os.path.join(self.basepath, "src")
setup.setup(self)
setup.do_migrations(self)
self.ircsock = None
self.lastReceived = None
self.user = None
self.channel = None
self.eventmanager = EventManager()
""" :type: EventManager"""
self.modulemanager = ModuleManager()
""" :type: ModuleManager"""
self.accessmanager = AccessManager()
""" :type: AccessManager"""
self.timemanager = TimeManager()
""" :type: TimeManager"""
self.run = True
示例5: run
def run(self):
import setup
_old_argv = _sys.argv
try:
_sys.argv = ['setup.py', '-q', 'build']
if not self.HIDDEN:
_sys.argv.remove('-q')
setup.setup()
if 'java' not in _sys.platform.lower():
_sys.argv = [
'setup.py', '-q', 'install_lib', '--install-dir',
shell.native(self.dirs['lib']),
'--optimize', '2',
]
if not self.HIDDEN:
_sys.argv.remove('-q')
setup.setup()
finally:
_sys.argv = _old_argv
for name in shell.files("%s/wtf" % self.dirs['lib'], '*.py'):
self.compile(name)
term.write("%(ERASE)s")
term.green("All files successfully compiled.")
示例6: test2
def test2():
"with index on 'country'"
cleanup(get_postgres_connection())
setup(get_postgres_connection())
run_queries(get_postgres_connection(), index_queries_gin)
get_mongo_client().test.test.ensure_index("country")
results = [0.0, 0.0, 0.0, 0.0]
test_base(1000, results)
print "test 2 - insert with GIN (+mongo index): ", results
示例7: check_setup
def check_setup():
try:
imp.find_module('dhtreader')
found = True
except ImportError:
found = False
if found is False:
import setup
setup.setup()
示例8: resetPrpr
def resetPrpr():
"""
Removes all files from working directories, invokes prpr setup.
"""
os.remove('prpr.db')
dirs = ['esc', 'incoming', 'logs', 'tables']
for dir in dirs:
files = os.listdir(dir)
for file in files:
os.remove(dir + os.sep + file)
import setup
setup.setup()
示例9: setUp
def setUp(self):
web_ca.app.config['TESTING'] = True
web_ca.app.config['WTF_CSRF_ENABLED'] = False
self.workdir = tempfile.mkdtemp()
setup.setup(self.workdir)
web_ca.app.config['WEB_CA_WORK_DIR'] = self.workdir
shutil.copy('test/ca.crt', self.workdir)
shutil.copy('test/ca.key', self.workdir)
self.app = web_ca.app.test_client()
示例10: execute
def execute(self, context):
# <self.logger> may be set in <setup(..)>
self.logger = None
# defines for which layerId's material is set per item instead of per layer
self.materialPerItem = set()
scene = context.scene
kwargs = {}
# setting active object if there is no active object
if context.mode != "OBJECT":
# if there is no object in the scene, only "OBJECT" mode is provided
if not context.scene.objects.active:
context.scene.objects.active = context.scene.objects[0]
bpy.ops.object.mode_set(mode="OBJECT")
if not self.app.has(Keys.mode3d):
self.mode = '2D'
# manager (derived from manager.Manager) performing some processing
self.managers = []
self.prepareLayers()
if not len(self.layerIndices):
self.layered = False
osm = Osm(self)
setup(self, osm)
if "lat" in scene and "lon" in scene and not self.ignoreGeoreferencing:
kwargs["projection"] = TransverseMercator(lat=scene["lat"], lon=scene["lon"])
else:
kwargs["projectionClass"] = TransverseMercator
osm.parse(**kwargs)
self.process()
self.render()
# setting 'lon' and 'lat' attributes for <scene> if necessary
if not "projection" in kwargs:
# <kwargs["lat"]> and <kwargs["lon"]> have been set in osm.parse(..)
scene["lat"] = osm.lat
scene["lon"] = osm.lon
if not self.app.has(Keys.mode3d):
self.app.show()
return {"FINISHED"}
示例11: main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('command_name')
parser.add_argument('command_args', nargs='*')
args = parser.parse_args()
command_name = args.command_name
command_args = args.command_args
if command_name == "setup":
generate_bulbsconf()
return setup(command_args)
if command_name == "bulbsconf":
return generate_bulbsconf()
config = Config()
# try to import graph from the local bulbsconf if it exists
path = config.working_dir
sys.path.insert(0, path)
from bulbsconf import graph
command = Command(config, graph)
command._execute(command_name, command_args)
示例12: __init__
def __init__(self):
conn = pymongo.Connection("localhost", 27017) # This creates a connection to local pymongo
self.db = conn["blog"]
if not self.db.posts.find_one({"title": "root"}): # If the blog is new installed root should not exist
setup.setup(conn["blog"]) # and so it will be created
handlers = routes
sidebar = get_archive_and_categories(self.db) # generate the data for sidebar
static_pages_list = get_static_pages_list(self.db) # and the static pages on navigation bar
page_data["sidebar"] = sidebar # then fill the page_data
page_data["static_pages_list"] = static_pages_list # It's expected that page_data will not change very often
page_data["blog_title"] = conf.blog_title # Man! less database calls!
settings = dict(template_path=os.path.join(os.path.dirname(__file__), "templates"),
static_path=os.path.join(os.path.dirname(__file__), "static"),
debug=conf.debug,)
tornado.web.Application.__init__(self, handlers, **settings)
示例13: setup
def setup(cmdline):
survey = model.survey.Survey.new(cmdline['project'])
# Cleanup of options.
if cmdline['global_id'] == '':
cmdline['global_id'] = None
import setup
return setup.setup(survey, cmdline)
示例14: app_factory
def app_factory(**local_conf):
settings = setup.setup(**local_conf)
app = App(settings)
app = werkzeug.wsgi.SharedDataMiddleware(app, {
'/css': os.path.join(settings.static_file_path, 'css'),
'/js': os.path.join(settings.static_file_path, 'js'),
'/img': os.path.join(settings.static_file_path, 'img'),
})
return app
示例15: main
def main():
# Main loop brings all of the functionality together
print "Initializing..."
if SETUP == True:
setup.setup()
time.sleep(5)
loopCount = 0
while True:
setup.scan()
data = readData()
display(data)
loopCount = loopCount +1
if loopCount >= loopLimit:
if shutdown == True:
followers.shutdownDisplay()
print "SHUT DOWN!"
os.system("sudo shutdown -h now")
else:
loopCount = 0