def __init__(self, configuration): Configurable.__init__(self, configuration) try: ## calibre plugin will set externally to match PI version. self.metadata = {'version': os.environ['CURRENT_VERSION_ID']} except: self.metadata = {'version': '4.4'} self.replacements = [] self.in_ex_cludes = {} self.chapters = [ ] # chapters will be namedtuple of Chapter(url,title,html,etc) self.chapter_first = None self.chapter_last = None self.imgurls = [] self.imgtuples = [] # save processed metadata, dicts keyed by 'key', then (removeentities,dorepl) # {'key':{(removeentities,dorepl):"value",(...):"value"},'key':... } self.processed_metadata_cache = {} self.cover = None # *href* of new cover image--need to create html. self.oldcover = None # (oldcoverhtmlhref,oldcoverhtmltype,oldcoverhtmldata,oldcoverimghref,oldcoverimgtype,oldcoverimgdata) self.calibrebookmark = None # cheesy way to carry calibre bookmark file forward across update. self.logfile = None # cheesy way to carry log file forward across update. self.replacements_prepped = False
def __init__(self, configuration): Configurable.__init__(self, configuration) try: ## calibre plugin will set externally to match PI version. self.metadata = {"version": os.environ["CURRENT_VERSION_ID"]} except: self.metadata = {"version": "4.4"} self.replacements = [] self.in_ex_cludes = {} self.chapters = [] # chapters will be namedtuple of Chapter(url,title,html,etc) self.chapter_first = None self.chapter_last = None self.imgurls = [] self.imgtuples = [] # save processed metadata, dicts keyed by 'key', then (removeentities,dorepl) # {'key':{(removeentities,dorepl):"value",(...):"value"},'key':... } self.processed_metadata_cache = {} self.cover = None # *href* of new cover image--need to create html. self.oldcover = ( None ) # (oldcoverhtmlhref,oldcoverhtmltype,oldcoverhtmldata,oldcoverimghref,oldcoverimgtype,oldcoverimgdata) self.calibrebookmark = None # cheesy way to carry calibre bookmark file forward across update. self.logfile = None # cheesy way to carry log file forward across update. self.replacements_prepped = False
def __init__(self): Configurable.__init__(self, ROOT.mithep.Analysis, 'mithep.Analysis') self._sequence = None self._outputMods = [] self.isRealData = False self.book = '' self.dataset = '' self.custom = {}
def __init__(self): Configurable.__init__(self, ROOT.mithep.Analysis, 'mithep.Analysis') self._sequence = None self._outputMods = [] self.isRealData = False self.book = '' self.dataset = '' self.custom = {}
def __init__(self, conf_path): # invoke the parent constructor Configurable.__init__(self, conf_path) # set variable values self.x0 = self.readCoord('width_start') self.y0 = self.readCoord('height_start') self.x1 = self.readCoord('width_end') self.y1 = self.readCoord('height_end')
def __init__(self, configuration): Configurable.__init__(self, configuration) try: ## calibre plugin will set externally to match PI version. self.metadata = {'version': os.environ['CURRENT_VERSION_ID']} except: self.metadata = {'version': '4.4'} self.in_ex_cludes = {} self.chapters = [ ] # chapters will be namedtuple of Chapter(url,title,html,etc) self.chapter_first = None self.chapter_last = None self.imgurls = [] self.imgtuples = [] self.cover = None # *href* of new cover image--need to create html. self.oldcover = None # (oldcoverhtmlhref,oldcoverhtmltype,oldcoverhtmldata,oldcoverimghref,oldcoverimgtype,oldcoverimgdata) self.calibrebookmark = None # cheesy way to carry calibre bookmark file forward across update. self.logfile = None # cheesy way to carry log file forward across update. ## Look for config parameter, split and add each to metadata field. for (config, metadata) in [("extracategories", "category"), ("extragenres", "genre"), ("extracharacters", "characters"), ("extraships", "ships"), ("extrawarnings", "warnings")]: for val in self.getConfigList(config): self.addToList(metadata, val) self.replacements = make_replacements( self.getConfig('replace_metadata')) in_ex_clude_list = [ 'include_metadata_pre', 'exclude_metadata_pre', 'include_metadata_post', 'exclude_metadata_post' ] for ie in in_ex_clude_list: ies = self.getConfig(ie) # print("%s %s"%(ie,ies)) if ies: iel = [] self.in_ex_cludes[ie] = set_in_ex_clude(ies)
def __init__(self, init_line): # invoke the parent initialisation method Configurable.__init__(self, self.OVR_PATH) # read whether the overlay is to be enabled self.enabled = self._setEnabled() if self.enabled: # read parametres from the config file self.opacity = self._setOpacity() self.position = self._setPosition() self.max_lines = self._setMaxLines() self.font = self._setFont() self.colors = self._setColors() self.root = self._setRoot(init_line) self.display = [] self.writeLine(init_line, 'info')
def __init__(self, configuration): Configurable.__init__(self, configuration) try: ## calibre plugin will set externally to match PI version. self.metadata = {'version':os.environ['CURRENT_VERSION_ID']} except: self.metadata = {'version':'4.4'} self.in_ex_cludes = {} self.chapters = [] # chapters will be namedtuple of Chapter(url,title,html,etc) self.chapter_first = None self.chapter_last = None self.imgurls = [] self.imgtuples = [] self.cover=None # *href* of new cover image--need to create html. self.oldcover=None # (oldcoverhtmlhref,oldcoverhtmltype,oldcoverhtmldata,oldcoverimghref,oldcoverimgtype,oldcoverimgdata) self.calibrebookmark=None # cheesy way to carry calibre bookmark file forward across update. self.logfile=None # cheesy way to carry log file forward across update. ## Look for config parameter, split and add each to metadata field. for (config,metadata) in [("extracategories","category"), ("extragenres","genre"), ("extracharacters","characters"), ("extraships","ships"), ("extrawarnings","warnings")]: for val in self.getConfigList(config): self.addToList(metadata,val) self.replacements = make_replacements(self.getConfig('replace_metadata')) in_ex_clude_list = ['include_metadata_pre','exclude_metadata_pre', 'include_metadata_post','exclude_metadata_post'] for ie in in_ex_clude_list: ies = self.getConfig(ie) # print("%s %s"%(ie,ies)) if ies: iel = [] self.in_ex_cludes[ie] = set_in_ex_clude(ies)
def __init__(self): Configurable.__init__(self, ROOT.mithep.Analysis, 'mithep.Analysis') self._sequence = None self.isRealData = False
def __init__(self, cppcls, clsName, *args, **kwargs): Configurable.__init__(self, cppcls, clsName, *args, **kwargs) Node.__init__(self, self._cppobj, self._cppobj.GetName())
def __init__(self, cppcls, clsName, *args, **kwargs): Configurable.__init__(self, cppcls, clsName, *args, **kwargs) Node.__init__(self, self._cppobj, self._cppobj.GetName())
def __init__(self): # PREPARE LOGGING FIRST TO ENSURE # THE ABILITY TO OUTPUT ERROR LOGS # # create logging folders self._makeLogDirs() # initialise the logger self.logger = self._setLogger() # catch exceptions to log them try: # call parent class constructor Configurable.__init__(self, self.SLF_PATH) # initialise overlay self.overlay = Overlay(f'{self.PRG_NAME.upper()} {self.PRG_VERS}') # point pytesseract at tesseract installation self._setPyTesseract() # initialise a lobby reader self.lobby_reader = LobbyReader() # initialise a loot reader self.loot_reader = LootReader() # initialise a bounty reader self.bounty_reader = BountyReader() # initialise a data sender self.data_sender = DataSender() # read user from config file self.user = self._setUser() # read game patch self.patch = self._setGamePatch() # initialise screen capture as empty self.screen_capture = None # data holders self.bounty_data = {} self.lobby_data = {} self.loot_data = [] # exception counter for repeated issue handling self.exc_counter = 0 # welcome the user self.welcomeMessage() except Exception as e: # log the exception self.logger.error(str(e)) # shut down the app quit()