App/View.py
def run(self):
        """
        Running the view class in the main

        Raises:
            exp: print the exception and restart the self.run() method
        """
        try:

            while True:
                self.menu()
                inp = self.inputs
                ans = False

                # known if the is auto or manual input
                if inp < 0:
                    inp = input("Select an option to continue\n")

                # starting a new gallery
                if int(inp) == 1:
                    ans = self.one(vvg_url, id_col, url_col)

                # saving gallery in file
                elif int(inp) == 2:
                    ans = self.two(expf, dataf)

                # loading gallery in memory
                elif int(inp) == 3:
                    ans = self.three(expf, dataf, id_col)

                # checking gallery in memory
                elif int(inp) == 4:
                    self.four()
                    ans = True

                # recovering letter metadata
                elif int(inp) == 5:
                    metadata_cols = [title_col, author_col,
                                     addressee_col, date_col, location_col]
                    ans = self.five(vvg_url, id_col, metadata_cols)

                # recovering letter original text
                elif int(inp) == 6:
                    ans = self.six(vvg_url, id_col, original_col)

                # recovering letter translation text
                elif int(inp) == 7:
                    ans = self.seven(vvg_url, id_col, translation_col)

                # recovering letter notes text
                elif int(inp) == 8:
                    ans = self.eight(vvg_url, id_col, notes_col)

                # recovering letter artworks
                elif int(inp) == 9:
                    artworks_cols = [artworks_title_col, artworks_f_col, artworks_jh_col, artworks_link_col,
                                     artworks_id_col]
                    ans = self.nine(vvg_url, id_col, artworks_cols)

                elif int(inp) == 10:
                    ans = self.ten(vvg_url, id_col, artworks_link_col,
                                   artworks_id_col, vvg_localpath)

                # exporting CSV columns into JSON foles
                elif int(inp) == 11:
                    self.eleven(id_col, json_index_cols)
                    ans = True

                elif int(inp) == 99:
                    # list of automatic steps
                    # (3, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 11, 2)
                    print("Auto executing options 3 to 11!!!...")
                    ans = True
                    ans = ans and self.three(expf, dataf, id_col)

                    metadata_cols = [title_col, author_col,
                                     addressee_col, date_col, location_col]
                    ans = ans and self.five(vvg_url, id_col, metadata_cols)
                    ans = ans and self.two(expf, dataf)

                    ans = ans and self.six(vvg_url, id_col, original_col)
                    ans = ans and self.two(expf, dataf)

                    ans = ans and self.seven(vvg_url, id_col, translation_col)
                    ans = ans and self.two(expf, dataf)

                    ans = ans and self.eight(vvg_url, id_col, notes_col)
                    ans = ans and self.two(expf, dataf)

                    artworks_cols = [artworks_title_col, artworks_f_col, artworks_jh_col, artworks_link_col,
                                     artworks_id_col]
                    ans = ans and self.nine(vvg_url, id_col, artworks_cols)
                    ans = ans and self.two(expf, dataf)

                    ans = ans and self.ten(
                        vvg_url, id_col, artworks_link_col, artworks_id_col, vvg_localpath)

                    self.eleven(id_col, json_index_cols)
                    ans = self.two(expf, dataf)

                    self.inputs = -1

                # exit program
                elif int(inp) == 0:
                    sys.exit(0)

                # other option selected
                else:
                    print("Invalid option, please try again...")

                # printing report after finishing task
                self.printre(ans)

        # exception handling
        except Exception as exp:
            print(exp)
            self.run()

        Running the view class in the main

        Raises:
            exp: print the exception and restart the self.run() method
        
Running the view class in the main
Running the view class in the main
def run(self):
        try:
            while True:
                self.menu()
                inp = self.inputs
                ans = False
                if inp < 0:
                    inp = input("Select an option to continue\n")
                if int(inp) == 1:
                    ans = self.one(vvg_url, id_col, url_col)
                elif int(inp) == 2:
                    ans = self.two(expf, dataf)
                elif int(inp) == 3:
                    ans = self.three(expf, dataf, id_col)
                elif int(inp) == 4:
                    self.four()
                    ans = True
                elif int(inp) == 5:
                    metadata_cols = [title_col, author_col,
                                     addressee_col, date_col, location_col]
                    ans = self.five(vvg_url, id_col, metadata_cols)
                elif int(inp) == 6:
                    ans = self.six(vvg_url, id_col, original_col)
                elif int(inp) == 7:
                    ans = self.seven(vvg_url, id_col, translation_col)
                elif int(inp) == 8:
                    ans = self.eight(vvg_url, id_col, notes_col)
                elif int(inp) == 9:
                    artworks_cols = [artworks_title_col, artworks_f_col, artworks_jh_col, artworks_link_col,
                                     artworks_id_col]
                    ans = self.nine(vvg_url, id_col, artworks_cols)
                elif int(inp) == 10:
                    ans = self.ten(vvg_url, id_col, artworks_link_col,
                                   artworks_id_col, vvg_localpath)
                elif int(inp) == 11:
                    self.eleven(id_col, json_index_cols)
                    ans = True
                elif int(inp) == 99:
                    print("Auto executing options 3 to 11!!!...")
                    ans = True
                    ans = ans and self.three(expf, dataf, id_col)
                    metadata_cols = [title_col, author_col,
                                     addressee_col, date_col, location_col]
                    ans = ans and self.five(vvg_url, id_col, metadata_cols)
                    ans = ans and self.two(expf, dataf)
                    ans = ans and self.six(vvg_url, id_col, original_col)
                    ans = ans and self.two(expf, dataf)
                    ans = ans and self.seven(vvg_url, id_col, translation_col)
                    ans = ans and self.two(expf, dataf)
                    ans = ans and self.eight(vvg_url, id_col, notes_col)
                    ans = ans and self.two(expf, dataf)
                    artworks_cols = [artworks_title_col, artworks_f_col, artworks_jh_col, artworks_link_col,
                                     artworks_id_col]
                    ans = ans and self.nine(vvg_url, id_col, artworks_cols)
                    ans = ans and self.two(expf, dataf)
                    ans = ans and self.ten(
                        vvg_url, id_col, artworks_link_col, artworks_id_col, vvg_localpath)
                    self.eleven(id_col, json_index_cols)
                    ans = self.two(expf, dataf)
                    self.inputs = -1
                elif int(inp) == 0:
                    sys.exit(0)
                else:
                    print("Invalid option, please try again...")
                self.printre(ans)
        except Exception as exp:
            print(exp)
            self.run()
def run ( self ) : try : while True : self . menu ( ) inp = self . inputs ans = False if inp < 0 : inp = input ( "Select an option to continue\n" ) if int ( inp ) == 1 : ans = self . one ( vvg_url , id_col , url_col ) elif int ( inp ) == 2 : ans = self . two ( expf , dataf ) elif int ( inp ) == 3 : ans = self . three ( expf , dataf , id_col ) elif int ( inp ) == 4 : self . four ( ) ans = True elif int ( inp ) == 5 : metadata_cols = [ title_col , author_col , addressee_col , date_col , location_col ] ans = self . five ( vvg_url , id_col , metadata_cols ) elif int ( inp ) == 6 : ans = self . six ( vvg_url , id_col , original_col ) elif int ( inp ) == 7 : ans = self . seven ( vvg_url , id_col , translation_col ) elif int ( inp ) == 8 : ans = self . eight ( vvg_url , id_col , notes_col ) elif int ( inp ) == 9 : artworks_cols = [ artworks_title_col , artworks_f_col , artworks_jh_col , artworks_link_col , artworks_id_col ] ans = self . nine ( vvg_url , id_col , artworks_cols ) elif int ( inp ) == 10 : ans = self . ten ( vvg_url , id_col , artworks_link_col , artworks_id_col , vvg_localpath ) elif int ( inp ) == 11 : self . eleven ( id_col , json_index_cols ) ans = True elif int ( inp ) == 99 : print ( "Auto executing options 3 to 11!!!..." ) ans = True ans = ans and self . three ( expf , dataf , id_col ) metadata_cols = [ title_col , author_col , addressee_col , date_col , location_col ] ans = ans and self . five ( vvg_url , id_col , metadata_cols ) ans = ans and self . two ( expf , dataf ) ans = ans and self . six ( vvg_url , id_col , original_col ) ans = ans and self . two ( expf , dataf ) ans = ans and self . seven ( vvg_url , id_col , translation_col ) ans = ans and self . two ( expf , dataf ) ans = ans and self . eight ( vvg_url , id_col , notes_col ) ans = ans and self . two ( expf , dataf ) artworks_cols = [ artworks_title_col , artworks_f_col , artworks_jh_col , artworks_link_col , artworks_id_col ] ans = ans and self . nine ( vvg_url , id_col , artworks_cols ) ans = ans and self . two ( expf , dataf ) ans = ans and self . ten ( vvg_url , id_col , artworks_link_col , artworks_id_col , vvg_localpath ) self . eleven ( id_col , json_index_cols ) ans = self . two ( expf , dataf ) self . inputs = - 1 elif int ( inp ) == 0 : sys . exit ( 0 ) else : print ( "Invalid option, please try again..." ) self . printre ( ans ) except Exception as exp : print ( exp ) self . run ( )
Running the view class in the main
Running the view class in the main
"""
        Running the view class in the main

        Raises:
            exp: print the exception and restart the self.run() method
        """ # known if the is auto or manual input # starting a new gallery # saving gallery in file # loading gallery in memory # checking gallery in memory # recovering letter metadata # recovering letter original text # recovering letter translation text # recovering letter notes text # recovering letter artworks # exporting CSV columns into JSON foles # list of automatic steps # (3, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 11, 2) # exit program # other option selected # printing report after finishing task # exception handling
print the exception and restart the self.run() method
print the exception and restart the self . run () method
exp
self