From 80acd6aa5a21039b98690d50619761b501eefb30 Mon Sep 17 00:00:00 2001 From: Manuel Pichardo Marcano Date: Sat, 26 Dec 2015 01:58:59 +0100 Subject: [PATCH 1/2] Update pythontex_install.py --- pythontex/pythontex_install.py | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/pythontex/pythontex_install.py b/pythontex/pythontex_install.py index 64ac0e4..6ed604b 100644 --- a/pythontex/pythontex_install.py +++ b/pythontex/pythontex_install.py @@ -141,60 +141,10 @@ # Get installation location from user -texmf_vars = [texmf_dist, texmf_local, texmf_home] -message = ''' - Choose an installation location. - - TEXMFDIST is a good choice if you want to update PythonTeX - in the future using your TeX distribution's package manager - (assuming that is supported). - - 1. TEXMFDIST - {0} - 2. TEXMFLOCAL - {1} - 3. TEXMFHOME - {2} - 4. Manual location - - 5. Exit without installing - '''.format(*[x if x else '' for x in texmf_vars]) - -if any(texmf_vars): - path_choice = '' - while (path_choice not in ('1', '2', '3', '4', '5') or - (int(path_choice) <= 3 and not texmf_vars[int(path_choice)-1])): - print(textwrap.dedent(message)) - path_choice = input('Installation location (number): ') - if path_choice == '': - sys.exit() - if path_choice == '1': - texmf_path = texmf_dist - elif path_choice == '2': - texmf_path = texmf_local - elif path_choice == '3': - texmf_path = texmf_home - elif path_choice == '4': - texmf_path = input('Enter a path:\n') - if texmf_path == '': - sys.exit() - if platform.system() == 'Windows': - if 'texlive' in texmf_path.lower(): - detected_texdist = True - texlive = True - miktex = False - elif 'miktex' in texmf_path.lower(): - detected_texdist = True - texlive = False - miktex = True - else: - sys.exit() -else: - print('Failed to detect possible installation locations automatically.') - print('TEXMF paths could not be located with kpsewhich.') - texmf_path = input('Plese enter an installation path, or press "Enter" to exit:\n') - if texmf_path == '': - sys.exit() +#texmf_vars = [texmf_dist, texmf_local, texmf_home] + +path_choice == '1': +texmf_path = texmf_dist # Make sure path slashes are compatible with the operating system # Kpathsea returns forward slashes, but Windows needs back slashes From f54ee6d0c0a99d722f6b880f8ea49b394164b6ec Mon Sep 17 00:00:00 2001 From: Manuel Pichardo Marcano Date: Sat, 26 Dec 2015 02:01:29 +0100 Subject: [PATCH 2/2] Update pythontex_install.py --- pythontex/pythontex_install.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pythontex/pythontex_install.py b/pythontex/pythontex_install.py index 6ed604b..ce269c2 100644 --- a/pythontex/pythontex_install.py +++ b/pythontex/pythontex_install.py @@ -26,7 +26,6 @@ `pythontex*.py` and `depythontex*.py`. Under MiKTeX, it attempts to create a batch file in `miktex/bin`. - Copyright (c) 2012-2014, Geoffrey M. Poore All rights reserved. Licensed under the BSD 3-Clause License: @@ -143,7 +142,7 @@ # Get installation location from user #texmf_vars = [texmf_dist, texmf_local, texmf_home] -path_choice == '1': +path_choice = '1' texmf_path = texmf_dist # Make sure path slashes are compatible with the operating system