Changeset 4225


Ignore:
Timestamp:
Jan 2, 2020 2:59:18 PM (22 months ago)
Author:
toby
Message:

Revise windows batch file creation for paths with spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/makeBat.py

    r4213 r4225  
    6767        datetime.datetime.now()))
    6868    activate = os.path.join(os.path.split(pythonexe)[0],'Scripts','activate')
    69     print(activate)
     69    print("Looking for",activate)
    7070    if os.path.exists(activate):
    71         print('adding activate to .bat file')
    72         activate = "call "+os.path.realpath(activate) + '\n'
     71        activate = os.path.realpath(activate)
     72        if ' ' in activate:
     73            activate = 'call "'+ activate + '"\n'
     74        else:
     75            activate = 'call '+ activate + '\n'
     76        print('adding activate to .bat file ({})'.format(activate))
    7377    else:
    74         print('activate not found')
     78        print('Anaconda activate not found')
    7579        activate = ''
    7680    pexe = pythonexe
Note: See TracChangeset for help on using the changeset viewer.