示例#1
0
    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
0
    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"
示例#3
0
    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()
示例#4
0
    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()
示例#5
0
    def execute(my):


        # 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)

        my.configure_db()
        my.configure_install()
        my.configure_services()
        my.configure_asset_dir()
        my.configure_palette()
        # FIXME: if this all fails, then revert back
        my.save_config()

        # after saving the config, test the database
        my.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)


        my.restart_program()
示例#6
0
    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__()))
示例#7
0
    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__()))