Changeset 3125


Ignore:
Timestamp:
Oct 6, 2017 10:12:31 AM (4 years ago)
Author:
vondreele
Message:

make python3 compatible change print statements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpath.py

    r3123 r3125  
    204204    out,err = s.communicate()
    205205    if err:
    206         print 'subversion error!\nout=',out
    207         print 'err=',err
     206        print ('subversion error!\nout=%s'%out)
     207        print ('err=%s'%err)
    208208        return None
    209209    return out.strip()
     
    246246    out,err = s.communicate()
    247247    if err:
    248         print 'out=',out
    249         print 'err=',err
     248        print ('out=%s'%out)
     249        print ('err=%s'%err)
    250250        return None
    251251    x = ET.fromstring(out)
     
    288288    out,err = s.communicate()
    289289    if err:
    290         print 'svn failed\n',out
    291         print 'err=',err
     290        print ('svn failed\n%s'%out)
     291        print ('err=%s'%err)
    292292        global svnLastError
    293293        svnLastError = err
     
    378378    if err:
    379379        print("svn upgrade did not happen (this is probably OK). Messages:")
    380         print err
     380        print (err)
    381381           
    382382def svnUpdateProcess(version=None,projectfile=None,branch=None):
     
    386386    else:
    387387        projectfile = os.path.realpath(projectfile)
    388         print 'restart using',projectfile
     388        print ('restart using %s'%projectfile)
    389389    if branch:
    390390        version = branch
     
    431431        print ("****** An error was noted, see below *********")
    432432        print(60*"=")
    433         print 'out=',out
    434         print 'err=',err
     433        print ('out=%s'%out)
     434        print ('err=%s'%err)
    435435        return False
    436436    if verbose:
     
    459459        print ("****** An error was noted, see below *********")
    460460        print(60*"=")
    461         print err
     461        print (err)
    462462        return False
    463463    print ("Files installed at: "+loadpath)
     
    502502    if verbose:
    503503        print('Running svn command')
    504         for item in cmd: print item,
    505         print ""
     504        for item in cmd: print (item,)
     505        print ("")
    506506    p = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
    507507    res,err = p.communicate()
     
    589589            from IPython.frontend.terminal.embed import InteractiveShellEmbed
    590590        except ImportError:
    591             print 'IPython InteractiveShellEmbed not found'
     591            print ('IPython InteractiveShellEmbed not found')
    592592            return
    593593    import inspect
     
    619619            from IPython.frontend.terminal.embed import InteractiveShellEmbed
    620620        except ImportError:
    621             print 'IPython InteractiveShellEmbed not found'
     621            print ('IPython InteractiveShellEmbed not found')
    622622            return
    623623    import inspect
     
    645645    'Called in GSASII.py to set up debug options'
    646646    if GetConfigValue('debug'):
    647         print 'Debug on: IPython: Exceptions and G2path.IPyBreak(); pdb: G2path.pdbBreak()'
     647        print ('Debug on: IPython: Exceptions and G2path.IPyBreak(); pdb: G2path.pdbBreak()')
    648648        sys.excepthook = exceptHook
    649649        import pdb
     
    802802                    print('Use of GSAS-II binary directory {} failed!'.format(binpath))
    803803                    print(75*'*')
    804                 raise Exception,"**** ERROR GSAS-II binary libraries not found, GSAS-II cannot run ****"
     804                raise Exception("**** ERROR GSAS-II binary libraries not found, GSAS-II cannot run ****")
    805805
    806806    # add the data import and export directory to the search path
     
    818818        vals = [True for i in inspect.getmembers(config) if '__' not in i[0]]
    819819        if printInfo:
    820             print str(len(vals))+' values read from config file '+os.path.abspath(config.__file__)
     820            print (str(len(vals))+' values read from config file '+os.path.abspath(config.__file__))
    821821    except ImportError:
    822822        configDict = {'Clip_on':True}
     
    853853        print("Restart GSAS-II without a project file ")
    854854        subprocess.Popen([ex,os.path.join(loc,'GSASII.py')])
    855     print 'exiting update process'
     855    print ('exiting update process')
    856856    sys.exit()
Note: See TracChangeset for help on using the changeset viewer.