当前位置: 首页>>代码示例>>Python>>正文


Python Config.unset_tmp_config方法代码示例

本文整理汇总了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"
开发者ID:blezek,项目名称:TACTIC,代码行数:29,代码来源:db_config_wdg.py

示例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()
开发者ID:mincau,项目名称:TACTIC,代码行数:58,代码来源:db_config_wdg.py

示例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__()))
开发者ID:0-T-0,项目名称:TACTIC,代码行数:43,代码来源:db_config_wdg.py


注:本文中的pyasm.common.Config.unset_tmp_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。