[pywin32-checkins] pywin32/win32/scripts rasutil.py, 1.3, 1.4 regsetup.py, 1.17, 1.18
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-12-04 03:38:25
|
Update of /cvsroot/pywin32/pywin32/win32/scripts In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23408/win32/scripts Modified Files: rasutil.py regsetup.py Log Message: remove use of string module Index: regsetup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/regsetup.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** regsetup.py 27 Nov 2008 04:15:21 -0000 1.17 --- regsetup.py 4 Dec 2008 03:38:20 -0000 1.18 *************** *** 90,94 **** regPath = regutil.GetRegisteredNamedPath(appName) if regPath: ! pathLook = string.split(regPath,";")[0] if regPath and FileExists(os.path.join(pathLook, knownFileName)): return None # The currently registered one is good. --- 90,94 ---- regPath = regutil.GetRegisteredNamedPath(appName) if regPath: ! pathLook = regPath.split(";")[0] if regPath and FileExists(os.path.join(pathLook, knownFileName)): return None # The currently registered one is good. *************** *** 130,134 **** import regutil, string try: ! string.index(fname, " ") # Other chars forcing quote? return '"%s"' % fname except ValueError: --- 130,134 ---- import regutil, string try: ! fname.index(" ") # Other chars forcing quote? return '"%s"' % fname except ValueError: *************** *** 145,149 **** """ import regutil, string, os ! fileNames = string.split(fileNamesString,";") for path in searchPaths: for fileName in fileNames: --- 145,149 ---- """ import regutil, string, os ! fileNames = fileNamesString.split(";") for path in searchPaths: for fileName in fileNames: *************** *** 201,208 **** the Python path. """ ! import string, os, regutil currentPath = regutil.GetRegisteredNamedPath(None) if currentPath: ! presearchPaths = string.split(currentPath, ";") else: presearchPaths = [os.path.abspath(".")] --- 201,208 ---- the Python path. """ ! import os, regutil currentPath = regutil.GetRegisteredNamedPath(None) if currentPath: ! presearchPaths = currentPath.split(";") else: presearchPaths = [os.path.abspath(".")] *************** *** 243,247 **** import regutil, string if not packageName: raise error("A package name must be supplied") ! corePaths = string.split(regutil.GetRegisteredNamedPath(None),";") if not searchPaths: searchPaths = corePaths registryAppName = registryAppName or packageName --- 243,247 ---- import regutil, string if not packageName: raise error("A package name must be supplied") ! corePaths = regutil.GetRegisteredNamedPath(None).split(";") if not searchPaths: searchPaths = corePaths registryAppName = registryAppName or packageName *************** *** 279,283 **** return ! regutil.RegisterNamedPath(appName, string.join(paths,";")) def FindRegisterPythonExe(exeAlias, searchPaths, actualFileNames = None): --- 279,283 ---- return ! regutil.RegisterNamedPath(appName, ";".join(paths)) def FindRegisterPythonExe(exeAlias, searchPaths, actualFileNames = None): *************** *** 317,321 **** sys.path.append(path) ! import string, os import regutil, win32api,win32con --- 317,321 ---- sys.path.append(path) ! import os import regutil, win32api,win32con *************** *** 323,327 **** # Register the core Pythonpath. print corePaths ! regutil.RegisterNamedPath(None, string.join(corePaths,";")) # Register the install path. --- 323,327 ---- # Register the core Pythonpath. print corePaths ! regutil.RegisterNamedPath(None, ';'.join(corePaths)) # Register the install path. *************** *** 493,497 **** if o=='-a': import regutil ! path = string.join(searchPaths,";") print "Registering application", a,"to path",path regutil.RegisterNamedPath(a,path) --- 493,497 ---- if o=='-a': import regutil ! path = ";".join(searchPaths) print "Registering application", a,"to path",path regutil.RegisterNamedPath(a,path) *************** *** 500,504 **** raise error("-c option must provide at least one additional path") import win32api, regutil ! currentPaths = string.split(regutil.GetRegisteredNamedPath(None),";") oldLen = len(currentPaths) for newPath in searchPaths: --- 500,504 ---- raise error("-c option must provide at least one additional path") import win32api, regutil ! currentPaths = regutil.GetRegisteredNamedPath(None).split(";") oldLen = len(currentPaths) for newPath in searchPaths: *************** *** 507,511 **** if len(currentPaths)!=oldLen: print "Registering %d new core paths" % (len(currentPaths)-oldLen) ! regutil.RegisterNamedPath(None,string.join(currentPaths,";")) else: print "All specified paths are already registered." --- 507,511 ---- if len(currentPaths)!=oldLen: print "Registering %d new core paths" % (len(currentPaths)-oldLen) ! regutil.RegisterNamedPath(None,";".join(currentPaths)) else: print "All specified paths are already registered." Index: rasutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/rasutil.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rasutil.py 27 Nov 2008 04:15:21 -0000 1.3 --- rasutil.py 4 Dec 2008 03:38:20 -0000 1.4 *************** *** 1,5 **** # A demo of using the RAS API from Python import sys - import string import win32ras --- 1,4 ---- *************** *** 19,23 **** assert numRetries > 0 for info in win32ras.EnumConnections(): ! if string.lower(info[1])==string.lower(rasEntryName): print "Already connected to", rasEntryName return 0, info[0] --- 18,22 ---- assert numRetries > 0 for info in win32ras.EnumConnections(): ! if info[1].lower()==rasEntryName.lower(): print "Already connected to", rasEntryName return 0, info[0] *************** *** 47,51 **** if type(handle)==type(''): # have they passed a connection name? for info in win32ras.EnumConnections(): ! if string.lower(info[1])==string.lower(handle): handle = info[0] break --- 46,50 ---- if type(handle)==type(''): # have they passed a connection name? for info in win32ras.EnumConnections(): ! if info[1].lower()==handle.lower(): handle = info[0] break |