Package pythonids :: Module prettypyids

Source Code for Module pythonids.prettypyids

 1  # -*- coding: utf-8 -*- 
 2  """Utility for pretty printout of pythonids. 
 3  """ 
 4  from __future__ import absolute_import 
 5  from __future__ import print_function 
 6   
 7  import sys 
 8   
 9  try: 
10      # 
11      # optional remote debug only 
12      # 
13      from rdbg import start        # load a slim bootstrap module 
14      start.start_remote_debug()    # check whether '--rdbg' option is present, if so accomplish bootstrap 
15   
16  except SystemExit: 
17      # 
18      # exit immediately after any type of help display - or any other intentional sys.exit() 
19      # print optional traceback 
20      #  1. after exit > 0 
21      #  2. if 3x --rdbg-self  
22      # 
23      _s = sys.exc_info() 
24      if '--rdbg-self' in sys.argv or _s[1].code > 0: 
25          print() 
26          import traceback 
27          print(traceback.print_exc()) 
28      print() 
29      sys.exit(_s[1].code) 
30   
31  except: 
32      pass 
33   
34  import pythonids 
35  import pythonids.pythondist 
36   
37   
38   
39  __author__ = 'Arno-Can Uestuensoez' 
40  __license__ = "Artistic-License-2.0 + Forced-Fairplay-Constraints" 
41  __copyright__ = "Copyright (C) 2019 Arno-Can Uestuensoez" \ 
42                  " @Ingenieurbuero Arno-Can Uestuensoez" 
43  __version__ = '0.1.1' 
44  __uuid__ = "60cac28d-efe6-4a8d-802f-fa4fc94fa741" 
45   
46  __docformat__ = "restructuredtext en" 
47   
48   
49  _debug = 0 
50  _verbose = 0 
51   
52   
53 -def ppretty_pythonids():
54 """Prints runtime parameters of the current Python syntax and implementation. 55 """ 56 57 sys.stderr.write('\n') 58 59 sys.stderr.write("\n#*\n#* pythonids:\n#*\n") 60 sys.stderr.write( 61 "%-20s= %s\n" % ( 62 "Python syntax", 63 str(pythonids.decode_pysyntax_16bit_to_str(pythonids.PYVxyz)) 64 ) 65 ) 66 sys.stderr.flush() 67 sys.stderr.write(str(pythonids.pythondist.PYDIST_DATA)) 68 sys.stderr.write('\n') 69 sys.stderr.flush() 70 71 sys.stderr.write('\n\n') 72 sys.stderr.flush()
73
74 -def main():
75 ppretty_pythonids()
76 77 if __name__ in ("__main__", "pythonids.prettypyids"): 78 main() 79 80 sys.exit(0) 81