def main(): parse_conf = ConfigFile('config.cfg') parse_conf.read_config_file() if not parse_conf.username: username = raw_input('Enter your username: '******'Logging in as {}'.format(username) password = getpass('Enter your password: '******'folder title'] download_images = raw_input('Download images? (y = yes, defaults to no) ') if download_images.lower() == 'y': dtl.download_images = True else: dtl.download_images = False dtl.base_path = os.path.join(dtl.base_path, dtl.docs_folder) print 'File path to save to is: ' + dtl.base_path dtl.download_folder_contents(docs_folder_feed['folder feed']) utilfunc.check_for_tex_extension(dtl.base_path) dtl.cleanup_leftover_comments() comp_latex = CompileLaTeX(dtl.base_path) comp_latex.replace_quote_characters() main_latex_file = raw_input('Enter the name of the main LaTeX file: ') if main_latex_file: comp_latex.compile_to_latex(main_latex_file) else: print 'No file name entered.' if not parse_conf.config_exists(): config_saved = """\ Your username ({}) and chosen folder ({}) have been saved in {}""".format( username, dtl.docs_folder, os.path.join(dtl.base_path, 'config.cfg')) print textwrap.dedent(config_saved) parse_conf.write_config_file(username=username, folder_name=dtl.docs_folder)
def main(): parse_conf = ConfigFile('config.cfg') parse_conf.read_config_file() if not parse_conf.username: username = raw_input('Enter your username: '******'Logging in as {}'.format(username) password = getpass('Enter your password: '******'folder title'] download_images = raw_input('Download images? (y = yes, defaults to no) ') if download_images.lower() == 'y': dtl.download_images = True else: dtl.download_images = False dtl.base_path = os.path.join(dtl.base_path, dtl.docs_folder) print 'File path to save to is: ' + dtl.base_path dtl.download_folder_contents(docs_folder_feed['folder feed']) utilfunc.check_for_tex_extension(dtl.base_path) dtl.cleanup_leftover_comments() comp_latex = CompileLaTeX(dtl.base_path) comp_latex.replace_quote_characters() main_latex_file = raw_input('Enter the name of the main LaTeX file: ') if main_latex_file: comp_latex.compile_to_latex(main_latex_file) else: print 'No file name entered.' if not parse_conf.config_exists(): config_saved = """\ Your username ({}) and chosen folder ({}) have been saved in {}""".format(username, dtl.docs_folder, os.path.join(dtl.base_path, 'config.cfg')) print textwrap.dedent(config_saved) parse_conf.write_config_file(username=username, folder_name=dtl.docs_folder)