Commit 10e0f16c2e2a50342c57211fc00725332aa8a8bb

Authored by decalage2
1 parent a5cf8cd5

ezhexviewer: added main function for entry points in setup.py - issue #69

Showing 1 changed file with 11 additions and 4 deletions
oletools/ezhexviewer.py
... ... @@ -16,7 +16,7 @@ Usage in a python application:
16 16  
17 17 ezhexviewer project website: http://www.decalage.info/python/ezhexviewer
18 18  
19   -ezhexviewer is copyright (c) 2012-2015, Philippe Lagadec (http://www.decalage.info)
  19 +ezhexviewer is copyright (c) 2012-2016, Philippe Lagadec (http://www.decalage.info)
20 20 All rights reserved.
21 21  
22 22 Redistribution and use in source and binary forms, with or without modification,
... ... @@ -40,12 +40,13 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 40 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 41 """
42 42  
43   -__version__ = '0.02'
44   -
45 43 #------------------------------------------------------------------------------
46 44 # CHANGELOG:
47 45 # 2012-09-17 v0.01 PL: - first version
48 46 # 2012-10-04 v0.02 PL: - added license
  47 +# 2016-09-06 v0.50 PL: - added main function for entry points in setup.py
  48 +
  49 +__version__ = '0.50'
49 50  
50 51 #------------------------------------------------------------------------------
51 52 # TODO:
... ... @@ -93,7 +94,9 @@ def hexview_file (filename, msg='', title='ezhexviewer', length=16, startindex=0
93 94 hexview_data(data, msg=msg, title=title, length=length, startindex=startindex)
94 95  
95 96  
96   -if __name__ == '__main__':
  97 +# === MAIN ===================================================================
  98 +
  99 +def main():
97 100 try:
98 101 filename = sys.argv[1]
99 102 except:
... ... @@ -103,3 +106,7 @@ if __name__ == '__main__':
103 106 hexview_file(filename, msg='File: %s' % filename)
104 107 except:
105 108 easygui.exceptionbox(msg='Error:', title='ezhexviewer')
  109 +
  110 +
  111 +if __name__ == '__main__':
  112 + main()
106 113 \ No newline at end of file
... ...