• R/O
  • SSH

pyrepo: Commit

Library with common primitives for Python_ programming language


Commit MetaInfo

Revisión5c2967d71bb087f112206f6dfc3ebfcd259a9aa7 (tree)
Tiempo2022-01-03 22:47:38
AutorSergey Gusarov <laborer2008@gmai...>
CommiterSergey Gusarov

Log Message

PEP8 fixes, print exception information to the console

Cambiar Resumen

Diferencia incremental

diff -r 1e82900c21e0 -r 5c2967d71bb0 cpu.py
--- a/cpu.py Mon Jan 03 16:34:48 2022 +0300
+++ b/cpu.py Mon Jan 03 16:47:38 2022 +0300
@@ -17,7 +17,8 @@
1717 def availableCpuCount():
1818 try:
1919 cpuCount = multiprocessing.cpu_count()
20- except:
20+ except Exception as e:
21+ print('Python exception:\"' + str(e) + '\"')
2122 cpuCount = 1
2223
2324 return cpuCount
diff -r 1e82900c21e0 -r 5c2967d71bb0 fs.py
--- a/fs.py Mon Jan 03 16:34:48 2022 +0300
+++ b/fs.py Mon Jan 03 16:47:38 2022 +0300
@@ -43,6 +43,8 @@
4343
4444 if doRaise:
4545 raise
46+ except Exception as e:
47+ print('Python exception:\"' + str(e) + '\"')
4648
4749
4850 def removeAllFilesInDir(dir, ignoreList = ['']):
@@ -192,6 +194,8 @@
192194
193195 if not os.path.isdir(path):
194196 raise
197+ except Exception as e:
198+ print('Python exception:\"' + str(e) + '\"')
195199
196200
197201 def extractFilesFromTarArchive(archive, destDir):
@@ -223,5 +227,5 @@
223227 shutil.copyfileobj(fIn, fOut)
224228
225229 return destFile
226- except OSError as e:
227- pass
230+ except Exception as e:
231+ print('Python exception:\"' + str(e) + '\"')
diff -r 1e82900c21e0 -r 5c2967d71bb0 internal/cleanall.py
--- a/internal/cleanall.py Mon Jan 03 16:34:48 2022 +0300
+++ b/internal/cleanall.py Mon Jan 03 16:47:38 2022 +0300
@@ -8,7 +8,6 @@
88
99 from glob import glob
1010 import os
11-import shutil
1211 import sys
1312
1413 sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
@@ -26,4 +25,5 @@
2625 fs.removeFile(os.path.join(pyRepoDir, 'pyrepo_README.pdf'))
2726 fs.removeFile(os.path.join(pyRepoDir, 'pyrepo_README_RU.pdf'))
2827
28+
2929 main()
diff -r 1e82900c21e0 -r 5c2967d71bb0 rst2pdfc.py
--- a/rst2pdfc.py Mon Jan 03 16:34:48 2022 +0300
+++ b/rst2pdfc.py Mon Jan 03 16:47:38 2022 +0300
@@ -55,7 +55,8 @@
5555 [kTemplate()],
5656 [kTemplate() + '\n' + kRevisionLocalizedStr() + ': ' + revision + '\n\n']
5757 )
58- except:
58+ except Exception as e:
59+ print('Python exception:\"' + str(e) + '\"')
5960 print('Couldn\'t find VCS info at the \'' + vcsDir + '\' directory and embed it to the output document')
6061 fs.removeFile(rstFileCopy)
6162 rstFileCopy = args.rst_file
Show on old repository browser