def __init__(self, scraper): ''' Initializes this form. 'scraper' -> the currently running ScrapeEngine ''' CVForm.__init__(self, scraper.comicrack.MainWindow, \ "comicformLocation", "comicformSize") # whether or not this form should call cancel when it is closed. # this is mainly to fix a difficult bug caused by calling cancel twice self.__cancel_on_close = True # stops us from calling close twice. also fixes a tricky bug. self.__already_closed = False # an internal reference to the main scrapeengine object self.__scraper = scraper # the book that is currently being scraped self.__current_book = None # the page from the currently scraped book that is currently displayed self.__current_page = 0 # the number of pages in the currently scraped book self.__current_page_count = 0 self.__build_gui()
def __init__(self, scraper, books): ''' Initializes this form. 'scraper' -> this the ScrapeEngine that we are running as part of. 'books' -> a list of all the comic books being scraped. ''' CVForm.__init__(self, scraper.comicrack.MainWindow, "welcomeformLocation") self.__build_gui(books);
def __init__(self, scraper, status): ''' Initializes this form. 'scraper' -> the ScrapeEngine that we are running as part of. 'status' -> a list containing two integers, the first is the number of books that were scraped and the second is the number that were skipped (both reported to the user by this form) ''' CVForm.__init__(self, scraper.comicrack.MainWindow, "finishformLocation") self.__build_gui( status[0], status[1] )
def __init__(self, scraper, book, series_refs, search_terms_s): ''' Initializes this form. 'scraper' -> the currently running ScrapeEngine 'book' -> the ComicBook being scraped 'series_refs' -> set or list containing the SeriesRefs to display 'search_terms_s' -> the user's search string that found the series models ''' # the the shared global configuration self.__config = scraper.config # a list of SeriesRef objects that back this form; one ref per table # row, where each SeriesRef represents a series the user can pick self.__series_refs = list(series_refs) # the MatchScore object that we use to compute series match scores self.__matchscore = MatchScore() # true when the user is pressing the control key, false otherwise self.__pressing_controlkey = False; # the 'ok' button for this dialog self.__ok_button = None # the 'skip' button for this dialog self.__skip_button = None # the 'show issues' button for this dialog self.__issues_button = None # the table that displays series (on per row) for the user to pick from self.__table = None # IssueCoverPanel that shows cover art for the current selected SeriesRef self.__coverpanel = None # the index (in self.__series_refs) of the currently selected SeriesRef self.__chosen_index = None if len(series_refs) <= 0: raise Exception("do not invoke the SeriesForm with no series!") CVForm.__init__(self, scraper.comicrack.MainWindow, "seriesformLocation") self.__build_gui(book, search_terms_s); scraper.cancel_listeners.append(self.Close)
def __init__(self, scraper, issue_ref_hint, issue_refs, series_ref): ''' Initializes this form. If a good issue key hint is given, that issue will be preselected in the table if possible. 'scraper' -> the currently running ScrapeEngine 'issue_ref_hint' -> may be the issue id for the given book (or may not!) 'issue_refs' -> a set or list containing the IssueRefs to display 'series_ref' -> SeriesRef for the series that the given issues belong to ''' # the the shared global configuration self.__config = scraper.config # a list of IssueRef objects that back this form; one ref per table row, # where each IssueRef represents an issue that the user can pick self.__issue_refs = list(issue_refs) # true when the user is pressing the control key, false otherwise self.__pressing_controlkey = False # the ok button for this dialog self.__ok_button = None # the skip button for this dialog self.__skip_button = None # the label for this dialog self.__label = None # the table that displays issues (one per row) for the user to pick from self.__table = None # whether or no we were able to pre-select the "hinted" issue in the table self.__found_issue_in_table = False # IssueCoverPAnel that shows the cover for the currently selected IssueRef self.__coverpanel = None ## the index (into self.__issue_refs) of the currently selected IssueRef self.__chosen_index = None if len(issue_refs) <= 0: raise Exception("do not invoke the IssueForm with no IssueRefs!") CVForm.__init__(self, scraper.comicrack.MainWindow, "issueformLocation") self.__build_gui(issue_ref_hint, series_ref) scraper.cancel_listeners.append(self.Close)
def __init__(self, scraper, issue_ref_hint, issue_refs, series_ref): """ Initializes this form. If a good issue key hint is given, that issue will be preselected in the table if possible. 'scraper' -> the currently running ScrapeEngine 'issue_ref_hint' -> may be the issue id for the given book (or may not!) 'issue_refs' -> a set or list containing the IssueRefs to display 'series_ref' -> SeriesRef for the series that the given issues belong to """ # the the shared global configuration self.__config = scraper.config # a list of IssueRef objects that back this form; one ref per table row, # where each IssueRef represents an issue that the user can pick self.__issue_refs = list(issue_refs) # true when the user is pressing the control key, false otherwise self.__pressing_controlkey = False # the ok button for this dialog self.__ok_button = None # the skip button for this dialog self.__skip_button = None # the label for this dialog self.__label = None # the table that displays issues (one per row) for the user to pick from self.__table = None # whether or no we were able to pre-select the "hinted" issue in the table self.__found_issue_in_table = False # IssueCoverPAnel that shows the cover for the currently selected IssueRef self.__coverpanel = None ## the index (into self.__issue_refs) of the currently selected IssueRef self.__chosen_index = None if len(issue_refs) <= 0: raise Exception("do not invoke the IssueForm with no IssueRefs!") CVForm.__init__(self, scraper.comicrack.MainWindow, "issueformLocation") self.__build_gui(issue_ref_hint, series_ref) scraper.cancel_listeners.append(self.Close)
def __init__(self, scraper, initial_search_s, failed_search_s=""): ''' Initializes this form. 'scraper' -> the currently running ScrapeEngine 'initial_search_s' -> the initial value in this form's text field. 'failed_search_s' -> (optional) the failed search terms associated with this SearchForm. If this is NOT empty, the search dialog will display an error message about the failed search terms couldn't be found ''' # the text label for this form (displays regular message) self.__label = None # the fail label for this form (display 'search failed' message) self.__fail_label = None # whether or not the fail label should be visible self.__fail_label_is_visible = failed_search_s and failed_search_s.strip() # the search button (i.e. the 'ok' button) for this form self.__search_button = None # true when the user is pressing the control key, false otherwise self.__pressing_controlkey = False; # the skip button for this form self.__skip_button = None # the cancel button for this form self.__cancel_button = None # the textbox for this form self.__textbox = None CVForm.__init__(self, scraper.comicrack.MainWindow, "searchformLocation") scraper.cancel_listeners.append(self.Close) self.__build_gui(initial_search_s, failed_search_s)
def __init__(self, owner, scrape_engine): """ Initializes this ProgressBarForm with the given owner window, and the given ScrapeEngine object, which will be cancelled if the user closes this Form manually. """ CVForm.__init__(self, owner, "pbformLocation") pb = ProgressBar() pb.Minimum = 0 pb.Maximum = 1 pb.Step = 1 pb.Value = 0 self.Height = 45 self.Width = 400 pb.Width = 400 self.Controls.Add(pb) self.pb = pb self.__scrape_engine = scrape_engine self.__cancel_on_close_b = True
def __init__(self, owner): ''' Initializes this form. owner -> this form's owner window/dialog ''' # these are the strings that the user sees for each checkbox; they can # also be used to reference each checkbox inside the checkboxlist ConfigForm.__SERIES_CB = i18n.get("ConfigFormSeriesCB") ConfigForm.__NUMBER_CB = i18n.get("ConfigFormNumberCB") ConfigForm.__PUBLISHED_CB = i18n.get("ConfigFormPublishedCB") ConfigForm.__RELEASED_CB = i18n.get("ConfigFormReleasedCB") ConfigForm.__TITLE_CB = i18n.get("ConfigFormTitleCB") ConfigForm.__CROSSOVERS_CB = i18n.get("ConfigFormCrossoversCB") ConfigForm.__WRITER_CB = i18n.get("ConfigFormWriterCB") ConfigForm.__PENCILLER_CB = i18n.get("ConfigFormPencillerCB") ConfigForm.__INKER_CB = i18n.get("ConfigFormInkerCB") ConfigForm.__COVER_ARTIST_CB = i18n.get("ConfigFormCoverCB") ConfigForm.__COLORIST_CB = i18n.get("ConfigFormColoristCB") ConfigForm.__LETTERER_CB = i18n.get("ConfigFormLettererCB") ConfigForm.__EDITOR_CB = i18n.get("ConfigFormEditorCB") ConfigForm.__SUMMARY_CB = i18n.get("ConfigFormSummaryCB") ConfigForm.__IMPRINT_CB = i18n.get("ConfigFormImprintCB") ConfigForm.__PUBLISHER_CB = i18n.get("ConfigFormPublisherCB") ConfigForm.__VOLUME_CB = i18n.get("ConfigFormVolumeCB") ConfigForm.__CHARACTERS_CB = i18n.get("ConfigFormCharactersCB") ConfigForm.__TEAMS_CB = i18n.get("ConfigFormTeamsCB") ConfigForm.__LOCATIONS_CB = i18n.get("ConfigFormLocationsCB") ConfigForm.__WEBPAGE_CB = i18n.get("ConfigFormWebCB") # the TabControl that contains all our TabPages self.__tabcontrol = None # the ok button for this dialog self.__ok_button = None # the cancel button for this dialog self.__cancel_button = None # the restore defaults button for this dialog self.__restore_button = None # "options" checkboxes self.__ow_existing_cb = None self.__ignore_blanks_cb = None self.__autochoose_series_cb = None self.__confirm_issue_cb = None self.__convert_imprints_cb = None self.__summary_dialog_cb = None self.__download_thumbs_cb = None self.__preserve_thumbs_cb = None self.__fast_rescrape_cb = None self.__rescrape_tags_cb = None self.__rescrape_notes_cb = None # "api key" textbox self.__api_key_tbox = None # "advanced settings" textbox self.__advanced_tbox = None # "data" checkbox list self.__update_checklist = None CVForm.__init__(self, owner, "configformLocation") self.__build_gui()