示例#1
0
    def dispatch(self):
        """
        Direct logic flow depending on passed command-line arguments.
        :return: None
        """
        if self.warn:
            self.issue_warnings()
            print(f'{ats()} Done!')
            sys.exit(1)

        if self.rebuild:
            answer = input("You sure you want to reparse? [yes/No]? ")
            if answer.lower() == 'yes':
                db = AssetDb()
                db.clear()
                db.setup()
                print(f"{ats()} Index cleared...")
            else:
                print(f"{ats()} Aborting...")
                sys.exit(1)

        self.parse()

        print(f"{ats()} Finished. Good job!")
        ok()
示例#2
0
    def dispatch(self):

        """
        Main class method that calls other methods depending on mode (index, download, update).
        :return: None
        """
        if self.index:
            if self.rebuild:
                answer = input("You sure you want to rebuild? [yes/No]? ")
                if answer.lower() == 'yes':
                    # Drop and recreate tables
                    db = IndexDb()
                    db.clear()
                    db.setup()
                    print(f"{ats()} Index cleared...")
                else:
                    print(f"{ats()} Aborting...")
                    sys.exit(1)
            self.build_index()

        if self.download:
            self.download_filings()

        print(f"{ats()} Finished. Good job!")
        ok()
示例#3
0
    def dispatch(self):
        """
        Direct logic flow depending on passed command-line arguments.
        :return: None
        """

        if self.rebuild:
            answer = input("You sure you want to reprocess? [yes/No]? ")
            if answer.lower() == 'yes':
                db = AssetDb()
                try:
                    db.clear_table(AutoloanFlat.__tablename__)
                except:
                    pass
                db.setup_table(AutoloanFlat.__tablename__)
                print(f"{ats()} Flat table cleared...")
            else:
                print(f"{ats()} Aborting...")
                sys.exit(1)

        self.process()

        print(f"{ats()} Finished. Good job!")
        ok()
 def ok(self):
     helpers.ok(self)