def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug self.size_cutoff = 16 self.max_headings = 40 self.aggression_threshold = 8 self.root = 0 Debuggable.__init__(self, 'Size Classifier')
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug self.size_cutoff = int(self.gv.settings.get_setting('minimum-heading-size', self)) self.max_headings = int(self.gv.settings.get_setting('maximum-headings', self)) self.root = 0 self.tree = None Debuggable.__init__(self, 'Size Classifier')
def __init__(self, gv): self.gv = gv self.debug = self.gv.debug self.zotero_items = [] self.mendeley_items = [] self.other_items = [] self.zotero_handler = ZoteroHandler(self.gv) self.mendeley_handler = MendeleyHandler(self.gv) self.other_handler = OtherHandler(self.gv) Debuggable.__init__(self, 'Bibliography Handler')
def __init__(self): self.args = self.read_command_line() self.debug = Debug() self.gv = GV() Debuggable.__init__(self, 'Main') if self.args.get('--debug'): self.debug.enable_debug() self.dr = self.args.get('<path>') self.f = self.args.get('<input_file>') self.tr = etree.parse(os.path.join(self.dr, self.f))
def __init__(self, global_variables, paragraph, replace_text, tree, manipulate, link_text='TO_LINK', length_ignore=False): self.paragraph = paragraph self.replace_text = replace_text self.gv = global_variables self.debug = self.gv.debug self.tree = tree self.manipulate = manipulate self.link_text = link_text self.length_ignore = length_ignore Debuggable.__init__(self, 'Reference Stub Linker Object')
def __init__(self): self.args = self.read_command_line() self.debug = Debug() self.gv = GV() Debuggable.__init__(self, 'Main') if self.args.get('--debug'): self.debug.enable_debug() self.dr = self.args.get('<path>') self.f = self.args.get('<input_file>') self.out_type = self.args.get('--out-type').lower() self.script_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
def __init__(self): self.args = self.read_command_line() self.debug = Debug() self.settings = Settings(self.args) self.gv = GV(self.settings) Debuggable.__init__(self, 'Main') if self.args.get('--debug'): self.debug.enable_debug() self.dr = self.args.get('<path>') self.f = self.args.get('<input_file>') self.stand_alone = self.args.get('--stand-alone') self.tr = etree.parse(os.path.join(self.dr, self.f))
def __init__(self): self.args = self.read_command_line() self.debug = Debug() self.settings = Settings(self.args) self.gv = GV(self.settings) Debuggable.__init__(self, 'Main') if self.args.get('--debug'): self.debug.enable_debug() self.dr = self.args.get('<path>') self.f = self.args.get('<input_file>') self.out_type = self.args.get('--out-type').lower() self.script_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
def __init__(self, debug): self.debug = debug Debuggable.__init__(self, 'Interactive Prompt Handler') # ANSI terminal colorization code heavily inspired by pygments: # http://dev.pocoo.org/hg/pygments-main/file/b2deea5b5030/pygments/console.py # (pygments is by Tim Hatch, Armin Ronacher, et al.) self.COLOR_ESCAPE = "\x1b[" self.DARK_COLORS = ["black", "darkred", "darkgreen", "brown", "darkblue", "purple", "teal", "lightgray"] self.LIGHT_COLORS = ["darkgray", "red", "green", "yellow", "blue", "fuchsia", "turquoise", "white"] self.RESET_COLOR = self.COLOR_ESCAPE + "39;49;00m"
def __init__(self): self.args = self.read_command_line() self.debug = Debug() self.gv = GV() Debuggable.__init__(self, 'Main') if self.args.get('--debug'): self.debug.enable_debug() self.current_result = datetime.datetime.now().strftime( "%Y_%m_%d-%H-%M-") + str(uuid.uuid4())[:8] self.config = self.gv.read_json(self.args['<config_file>']) self.all_typesetters = self.config.get('typesetters')
def __init__(self): self.args = self.read_command_line() self.debug = Debug() self.settings = Settings(self.args) self.gv = GV(self.settings) Debuggable.__init__(self, 'Main') if self.args.get('--debug'): self.debug.enable_debug() self.current_result = datetime.datetime.now().strftime( "%Y_%m_%d-%H-%M-%S-") + str(uuid.uuid4())[:4] self.config = None self.all_typesetters = None self.script_folder = os.path.dirname(os.path.realpath(__file__))
def __init__(self): self.args = self.read_command_line() self.debug = Debug() self.settings = Settings(self.args) self.gv = GV(self.settings) self.dr = self.args.get('<path>') self.f = self.args.get('<input_file>') self.scheme = self.args.get('<scheme>') self.set_numbering_tags = self.args.get('--set-numbering-tags') self.tr = etree.parse(os.path.join(self.dr, self.f)) Debuggable.__init__(self, 'Main') if self.args.get('--debug'): self.debug.enable_debug()
def __init__(self): self.args = self.read_command_line() self.debug = Debug() self.gv = GV() self.uid = self.gv.uuid self.dr = self.args.get("<path>") self.f = self.args.get("<input_file>") self.scheme = self.args.get("<scheme>") self.set_numbering_tags = self.args.get("--set-numbering-tags") self.tr = etree.parse(os.path.join(self.dr, self.f)) Debuggable.__init__(self, "Main") if self.args.get("--debug"): self.debug.enable_debug()
def __init__(self, text, debug, stopwords=None, nostem=None): """ Store the raw text, tokenize. Args: text (str): The raw text string. stopwords (str): A custom stopwords list path. """ self.debug = debug Debuggable.__init__(self, 'TextPlot') self.text = text self.load_stopwords(stopwords) self.load_nostem(nostem) self.tokenize()
def __init__(self, debug): self.debug = debug Debuggable.__init__(self, 'Interactive Prompt Handler') # ANSI terminal colorization code heavily inspired by pygments: # http://dev.pocoo.org/hg/pygments-main/file/b2deea5b5030/pygments/console.py # (pygments is by Tim Hatch, Armin Ronacher, et al.) self.COLOR_ESCAPE = "\x1b[" self.DARK_COLORS = [ "black", "darkred", "darkgreen", "brown", "darkblue", "purple", "teal", "lightgray" ] self.LIGHT_COLORS = [ "darkgray", "red", "green", "yellow", "blue", "fuchsia", "turquoise", "white" ] self.RESET_COLOR = self.COLOR_ESCAPE + "39;49;00m"
def __init__(self): # read command line arguments self.args = self.read_command_line() # absolute first priority is to initialize debugger so that anything triggered here can be logged self.debug = Debug() Debuggable.__init__(self, 'cassius-import') self.in_file = self.args['<in-file>'] self.out_file = self.args['<out-file>'] self.dir = os.path.dirname(os.path.abspath(__file__)) if self.args['--debug']: self.debug.enable_debug() self.debug.enable_prompt(Interactive(self.args['--debug']))
def __init__(self): # read command line arguments self.args = docopt(__doc__, version='meTypeset 0.1') # absolute first priority is to initialize debugger so that anything triggered here can be logged self.debug = Debug() if self.args['--debug']: self.debug.enable_debug() # read settings file self.settings_file_path = 'default' self.tei_file_path = None self.setup_settings_file() self.settings = SettingsConfiguration(self.get_settings_file(), self.args) self.gv = GV(self.settings, self.debug) self.debug = self.gv.debug Debuggable.__init__(self, 'Main')
def __init__(self): # read command line arguments self.args = self.read_command_line() # absolute first priority is to initialize debugger so that anything triggered here can be logged self.debug = Debug() Debuggable.__init__(self, 'plotsummary') self.in_dir = self.args['<directory>'] self.term_file = self.args['<term_file>'] self.terms = [line.strip().lower() for line in open(self.term_file)] self.dir = os.path.dirname(os.path.abspath(__file__)) if self.args['--debug']: self.debug.enable_debug() self.debug.enable_prompt(Interactive(self.args['--debug'])) if self.args['--caption']: self.caption = self.args['--caption'] else: self.caption = 'Term Plot' if self.args['--nostem']: self.nostem = self.args['--nostem'] else: self.nostem = None if self.args['single']: self.action = 'single' elif self.args['group']: self.second_term_file = self.args['<second_term_file>'] self.term_name = self.args['<term_name>'] self.second_term_name = self.args['<second_term_name>'] self.second_terms = [line.strip().lower() for line in open(self.second_term_file)] self.action = 'group' elif self.args['hist']: self.action = 'hist' elif self.args['rawcount']: self.action = 'rawcount'
def __init__(self): # read command line arguments self.args = self.read_command_line() # absolute first priority is to initialize debugger so that anything triggered here can be logged self.debug = Debug() Debuggable.__init__(self, 'Main') if self.args['--debug']: self.debug.enable_debug(self.args['--nogit']) # read settings file self.settings_file_path = 'default' self.tei_file_path = None self.settings_file_path = Settings.setup_settings_file(self.args) self.settings = Settings(Settings.get_settings_file(self, self.settings_file_path), self.args) self.gv = GV(self.settings, self.debug) self.debug.enable_prompt(Interactive(self.gv))
def __init__(self): # read command line arguments self.args = self.read_command_line() # absolute first priority is to initialize debugger so that anything triggered here can be logged self.debug = Debug() Debuggable.__init__(self, 'CWF') self.corpus = self.args['<corpus_directory>'] self.words = self.args['<word_list>'].split(",") self.output = self.args['<output_csv>'] self.terms = {} self.years = [] self.year_count = {} if self.args['--debug']: self.debug.enable_debug() self.debug.enable_prompt(Interactive(self.args['--debug']))
def __init__(self): # read command line arguments self.args = docopt(__doc__, version='meTypeset 0.1') # initialize debugger self.debug = Debug() self.debug.enable_debug() Debuggable.__init__(self, 'mePrePrint') # get arguments self.doc_type = self.args['--type'] self.title = self.args['--article_title'] self.name = self.args['--author'] self.copyright_year = self.args['--year'] self.copyright = self.args['--copyright'] self.citation = self.args['--citation'] self.url = self.args['--url'] if self.doc_type == 'preprint': self.version = 'pre-print (not peer reviewed)' elif self.doc_type == 'postprint': self.version = 'post-print (peer reviewed)' elif self.doc_type == 'final': self.version = 'final publisher'
def __init__(self, global_variables): Debuggable.__init__(self, 'Bibliography Database') self.gv = global_variables self.debug = self.gv.debug self.size_cutoff = 16 self.aggression = 8
def __init__(self, zotero_path, global_variables, noteProvider=None): Debuggable.__init__(self, 'libZotero') self.gv = global_variables self.debug = self.gv.debug """ Intialize zotero. Arguments: zotero_path -- A unicode string to the Zotero folder. Keyword arguments: noteProvider -- A noteProvider object. (default=None) """ self.debug.print_debug( self, u"zotero.__init__(): zotero_path = %s" % zotero_path) # Set paths self.zotero_path = zotero_path self.storage_path = os.path.join(self.zotero_path, u"storage") self.zotero_database = os.path.join(self.zotero_path, u"zotero.sqlite") self.noteProvider = noteProvider if os.name == u"nt": home_folder = os.environ[u"USERPROFILE"].decode( \ sys.getfilesystemencoding()) elif os.name == u"posix": home_folder = os.environ[u"HOME"].decode( \ sys.getfilesystemencoding()) else: self.debug.print_debug( self, u"zotero.__init__(): you appear to be running an unsupported OS" ) self.gnotero_database = os.path.join(home_folder, u".gnotero.sqlite") # Remember search results so results speed up over time self.search_cache = {} # Check whether verbosity is turned on self.verbose = "-v" in sys.argv # These dates are treated as special and are not parsed into a year # representation self.special_dates = u"in press", u"submitted", u"in preparation", \ u"unpublished" # These extensions are recognized as fulltext attachments self.attachment_ext = u".pdf", u".epub" self.index = {} self.collection_index = [] self.tag_index = [] self.last_update = None # The notry parameter can be used to show errors which would # otherwise be obscured by the try clause if "--notry" in sys.argv: self.search(u"dummy") # Start by updating the database try: self.search(u"dummy") self.error = False except Exception as e: self.debug.print_debug(self, e) self.error = True
def __init__(self, gv): self.gv = gv self.debug = self.gv.debug Debuggable.__init__(self, '{0} Manipulator'.format(self.mod_name))
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug Debuggable.__init__(self, 'ID Generator')
def __init__(self, gv): self.gv = gv self.debug = self.gv.debug Debuggable.__init__(self, 'Zotero Handler')
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug Debuggable.__init__(self, "Bibliography Classifier")
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug Debuggable.__init__(self, 'List Classifier')
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug Debuggable.__init__(self, 'Bibliography Classifier')
def __init__(self, gv): self.gv = gv self.debug = gv.debug Debuggable.__init__(self, 'UNOCONV to DOCX')
def __init__(self, gv): self.gv = gv self.debug = gv.debug Debuggable.__init__(self, 'DOCX to TEI')
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug Debuggable.__init__(self, 'Compliance Enforcer')
def __init__(self, gv): self.gv = gv self.debug = self.gv.debug Debuggable.__init__(self, 'Mendeley Handler')
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug Debuggable.__init__(self, 'Caption Classifier')
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug self.ibid = None Debuggable.__init__(self, 'Reference Linker')
def __init__(self, global_variables, paragraph, reference_to_link): self.paragraph = paragraph self.reference_to_link = reference_to_link self.gv = global_variables self.debug = self.gv.debug Debuggable.__init__(self, 'Reference Linker Object')
def __init__(self, zotero_path, global_variables, noteProvider=None): Debuggable.__init__(self, 'libZotero') self.gv = global_variables self.debug = self.gv.debug """ Intialize zotero. Arguments: zotero_path -- A unicode string to the Zotero folder. Keyword arguments: noteProvider -- A noteProvider object. (default=None) """ assert (isinstance(zotero_path, unicode)) self.debug.print_debug(self, u"zotero.__init__(): zotero_path = %s" % zotero_path) # Set paths self.zotero_path = zotero_path self.storage_path = os.path.join(self.zotero_path, u"storage") self.zotero_database = os.path.join(self.zotero_path, u"zotero.sqlite") self.noteProvider = noteProvider if os.name == u"nt": home_folder = os.environ[u"USERPROFILE"].decode( \ sys.getfilesystemencoding()) elif os.name == u"posix": home_folder = os.environ[u"HOME"].decode( \ sys.getfilesystemencoding()) else: self.debug.print_debug(self, u"zotero.__init__(): you appear to be running an unsupported OS") self.gnotero_database = os.path.join(home_folder, u".gnotero.sqlite") # Remember search results so results speed up over time self.search_cache = {} # Check whether verbosity is turned on self.verbose = "-v" in sys.argv # These dates are treated as special and are not parsed into a year # representation self.special_dates = u"in press", u"submitted", u"in preparation", \ u"unpublished" # These extensions are recognized as fulltext attachments self.attachment_ext = u".pdf", u".epub" self.index = {} self.collection_index = [] self.tag_index = [] self.last_update = None # The notry parameter can be used to show errors which would # otherwise be obscured by the try clause if "--notry" in sys.argv: self.search(u"dummy") # Start by updating the database try: self.search(u"dummy") self.error = False except Exception as e: self.debug.print_debug(self, e) self.error = True
def __init__(self, global_variables): self.gv = global_variables self.debug = self.gv.debug self.skiplist = [] Debuggable.__init__(self, 'List Classifier')
def __init__(self, gv): self.gv = gv self.debug = self.gv.debug self.found_biblio = False Debuggable.__init__(self, 'Zotero Handler')
def __init__(self, gv): self.gv = gv self.debug = self.gv.debug Debuggable.__init__(self, 'Other Addin Handler')