本文整理汇总了Python中pyasm.common.Config.unset_tmp_config方法的典型用法代码示例。如果您正苦于以下问题:Python Config.unset_tmp_config方法的具体用法?Python Config.unset_tmp_config怎么用?Python Config.unset_tmp_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.common.Config
的用法示例。
在下文中一共展示了Config.unset_tmp_config方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from pyasm.common import Config [as 别名]
# 或者: from pyasm.common.Config import unset_tmp_config [as 别名]
def execute(my):
# make sure tmp config is unset.
Config.unset_tmp_config()
Config.reload_config()
web = WebContainer.get_web()
vendor = web.get_form_value("database/vendor")
if vendor == 'Sqlite':
db_dir = web.get_form_value("database/sqlite_db_dir")
database = "sthpw"
db_path = "%s/%s.db" % (db_dir, database)
if os.path.exists(db_path):
return
elif vendor == 'PostgreSQL':
my.test_postgres(vendor)
return
elif vendor in ['MySQL','SQLServer','Oracle']:
my.test_postgres(vendor)
return
my.info['error'] = "Cannot connect to database"
示例2: execute
# 需要导入模块: from pyasm.common import Config [as 别名]
# 或者: from pyasm.common.Config import unset_tmp_config [as 别名]
def execute(self):
self.section = None
# make sure tmp config is unset.
Config.unset_tmp_config()
Config.reload_config()
web = WebContainer.get_web()
# read the current config file.
# copy config to the path
config_path = Config.get_config_path()
if not os.path.exists(config_path):
print "Installing default config file"
dirname = os.path.dirname(config_path)
if not os.path.exists(dirname):
os.makedirs(dirname)
if os.name == 'nt':
osname = 'win32'
else:
osname = 'linux'
install_dir = Environment.get_install_dir()
install_config_path = "%s/src/install/start/config/tactic_%s-conf.xml" % ( install_dir, osname)
shutil.copy(install_config_path, dirname)
try:
self.configure_db()
self.configure_install()
self.configure_mail_services()
self.configure_gen_services()
self.configure_asset_dir()
self.configure_palette()
self.configure_security()
except Exception as e:
raise TacticException('Error in [%s]: %s'%(self.section, e.__str__()))
# FIXME: if this all fails, then revert back
self.save_config()
# after saving the config, test the database
self.load_bootstrap()
# remove the first run file
data_dir = Environment.get_data_dir()
path = "%s/first_run" % data_dir
if os.path.exists(path):
os.unlink(path)
self.restart_program()
示例3: execute
# 需要导入模块: from pyasm.common import Config [as 别名]
# 或者: from pyasm.common.Config import unset_tmp_config [as 别名]
def execute(my):
my.section = None
# make sure tmp config is unset.
Config.unset_tmp_config()
Config.reload_config()
web = WebContainer.get_web()
# read the current config file.
# copy config to the path
config_path = Config.get_config_path()
if not os.path.exists(config_path):
print "Installing default config file"
dirname = os.path.dirname(config_path)
if not os.path.exists(dirname):
os.makedirs(dirname)
if os.name == 'nt':
osname = 'win32'
else:
osname = 'linux'
install_dir = Environment.get_install_dir()
install_config_path = "%s/src/install/start/config/tactic_%s-conf.xml" % ( install_dir, osname)
shutil.copy(install_config_path, dirname)
try:
my.configure_db()
my.configure_install()
my.configure_mail_services()
my.configure_gen_services()
my.configure_asset_dir()
my.configure_palette()
my.configure_security()
except Exception, e:
raise TacticException('Error in [%s]: %s'%(my.section, e.__str__()))