def __init__(self, template): self.BASENAME = template.lower() self.PATH = TEAX_REAL_PATH + '/templates/' + self.BASENAME if not os.path.exists(self.PATH): tty.error(T_TEMPLATE_NOT_EXISTS % self.BASENAME) tty.info(T_USING_TEMPLATE % self.BASENAME)
def mount(self, filename): copy_tree(TEAX_WORK_PATH, TEAX_WORK_PATH + '/.teax/') if not os.path.splitext(filename)[1]: filename = os.path.basename(filename) + '.tex' if not os.path.isfile(filename): tty.error(T_FILE_NOT_EXISTS % filename) self.shelf['filename'] = filename engines_list = engines.analyze(filename) engine = max(engines_list.iteritems(), key=operator.itemgetter(1))[0] self.shelf['engine'] = engine