本文整理汇总了Python中Server.getBanner方法的典型用法代码示例。如果您正苦于以下问题:Python Server.getBanner方法的具体用法?Python Server.getBanner怎么用?Python Server.getBanner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server
的用法示例。
在下文中一共展示了Server.getBanner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: newApp
# 需要导入模块: import Server [as 别名]
# 或者: from Server import getBanner [as 别名]
def newApp(args, options):
from j25.Configuration import Configuration
if len(args) < 2:
print >> sys.stderr, "you must supply the name of the app"
exit(1)
_checkProject(AUTO_PROJECT_DIRS)
appName = args[1]
appDirectory = os.path.join('apps', appName)
print Server.getBanner()
print COLOR_SEQ % 33
try:
_createPythonPackage(HERE, appDirectory, True)
f = open(os.path.join(appDirectory, 'config.py'), 'w')
f.write(app_config_template)
f.close()
f = open(os.path.join(appDirectory, 'routing.py'), 'w')
f.write(app_routing_template % appName)
f.close()
for directory, is_python_package in AUTO_APP_DIRS:
_createPythonPackage(appDirectory, directory, is_python_package)
#update configuration
config = Configuration.load_file("server.ini", False)
currentApps = eval(config.main.applications)
assert isinstance(currentApps, list)
currentApps.append('apps.%s' % appName)
config.main.applications = str(list(set(currentApps)))
Configuration.dump_file("server.ini", config)
logger.info("Application %s has been created. Current project has been configured." % appName)
finally:
print RESET_SEQ
示例2: newProject
# 需要导入模块: import Server [as 别名]
# 或者: from Server import getBanner [as 别名]
def newProject(args, options):
from j25.Configuration import Configuration
if len(args) < 2:
print >> sys.stderr, "Please supply a project name"
exit(1)
appName = options.withapp
projectName = args[1]
print Server.getBanner()
print COLOR_SEQ % 33
print "Creating project: %s" % projectName
_createPythonPackage(HERE, projectName, False)
#creating project structure
for directory, is_python_package in AUTO_PROJECT_DIRS:
_createPythonPackage(projectName, directory, is_python_package)
#creating templates
config = Configuration.create_empty_config()
s1 = config.add_section('main')
s1.add_option('project_name', projectName)
s1.add_option('applications', [])
s1.add_option('excluded_applications_from_worker', [])
s1.add_option("mode", "DEV")
s1.add_option("ip", "0.0.0.0")
s1.add_option("port", "8800")
s1.add_option("is_subdomain_aware", True)
s2 = config.add_section('session')
s1.add_option('project_name', projectName)
s2.add_option('secret', uuid4().hex + uuid4().hex)
s2.add_option('url', ('%s/c9#session' % Constants.MONGODB_URL))
s2.add_option('secure', 'False')
s2.add_option('timeout', '600')
s3 = config.add_section('store')
s3.add_option("db_name", "c9_%s" % projectName)
s3.add_option("ip", "127.0.0.1")
s3.add_option("auto_create_collections", None)
Configuration.dump_file(os.path.join(projectName, 'server.ini'), config)
f = open(os.path.join(projectName, 'routing.py'), 'w')
f.write(project_routing_template)
f.close()
f = open(os.path.join(projectName, 'workerconfig.py'), 'w')
f.write(app_workerconfig)
f.close()
if options.withapp:
config = Configuration.load_file(os.path.join(projectName, 'server.ini'), False)
builtin_Apps = eval(config.main.applications)
assert isinstance(builtin_Apps, list)
if not appName in builtin_Apps:
builtin_Apps.append(appName)
config.main.applications = str(builtin_Apps)
Configuration.dump_file(os.path.join(projectName, 'server.ini'), config)
logger.info("\033[1;33mProject %s Created with Application %s.\033[0m"% (projectName, appName))
else:
logger.info("\033[1;33mApplication %s already installed in the project by Default.\033[0m" % appName)
print RESET_SEQ
示例3: installApp
# 需要导入模块: import Server [as 别名]
# 或者: from Server import getBanner [as 别名]
def installApp(args, options):
from j25.Configuration import Configuration
if len(args) < 2:
print >> sys.stderr, "you must supply the name of the app"
exit(1)
_checkProject(AUTO_PROJECT_DIRS)
appName = args[1]
print Server.getBanner()
print COLOR_SEQ % 33
config = Configuration.load_file('server.ini', False)
currentApps = eval(config.main.applications)
assert isinstance(currentApps, list)
if not appName in currentApps:
currentApps.append(appName)
config.main.applications = str(currentApps)
Configuration.dump_file('server.ini', config)
logger.info("\033[1;33mApplication %s added to project.\033[0m"% appName)
else:
logger.info("\033[1;33mApplication %s already installed in the project.\033[0m" % appName)