Library with common primitives for Python_ programming language
Revisión | ae2507df32a60cc93424b804cbbbce892710daaf (tree) |
---|---|
Tiempo | 2021-12-10 08:18:52 |
Autor | Sergey Gusarov <laborer2008@gmai...> |
Commiter | Sergey Gusarov |
fs: Quoted path items
@@ -17,26 +17,26 @@ | ||
17 | 17 | |
18 | 18 | def cleanDir(dir): |
19 | 19 | dir = os.path.abspath(dir) |
20 | - print('Deleting: ' + dir) | |
20 | + print('Deleting: \'' + dir + '\'') | |
21 | 21 | shutil.rmtree(dir, ignore_errors = True) |
22 | 22 | |
23 | 23 | |
24 | 24 | def removeFile(file, ignoreNotFound = True): |
25 | 25 | file = os.path.abspath(file) |
26 | - print('Deleting: ' + file) | |
26 | + print('Deleting: \'' + file + '\'') | |
27 | 27 | |
28 | 28 | try: |
29 | 29 | if os.path.isfile(file): |
30 | 30 | os.unlink(file) |
31 | 31 | else: |
32 | - print(file + ' - not a file') | |
32 | + print('\'' + file + '\' - not a file') | |
33 | 33 | except OSError as e: |
34 | 34 | if ignoreNotFound: |
35 | 35 | if e.errno != errno.ENOENT: |
36 | 36 | doRaise = True |
37 | 37 | else: |
38 | 38 | doRaise = False |
39 | - print('File ' + file + ' not found') | |
39 | + print('File \'' + file + '\' was not found') | |
40 | 40 | else: |
41 | 41 | doRaise = True |
42 | 42 |
@@ -91,7 +91,7 @@ | ||
91 | 91 | makeSurePathExists(dir) |
92 | 92 | shutil.copy(file, dir) |
93 | 93 | else: |
94 | - print(file + ' - not a file') | |
94 | + print('\'' + file + '\' - not a file') | |
95 | 95 | |
96 | 96 | |
97 | 97 | def copyTree(src, dest, verbose = 0): |
@@ -182,7 +182,7 @@ | ||
182 | 182 | def makeFileExecutable(file): |
183 | 183 | file = os.path.abspath(file) |
184 | 184 | |
185 | - print('Adding executable bit to the file ' + file) | |
185 | + print('Adding executable bit to the file \'' + file + '\'') | |
186 | 186 | st = os.stat(file) |
187 | 187 | os.chmod(file, st.st_mode | stat.S_IEXEC) |
188 | 188 |