Commit 10e0f16c2e2a50342c57211fc00725332aa8a8bb
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,7 +16,7 @@ Usage in a python application: | ||
| 16 | 16 | ||
| 17 | ezhexviewer project website: http://www.decalage.info/python/ezhexviewer | 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 | All rights reserved. | 20 | All rights reserved. |
| 21 | 21 | ||
| 22 | Redistribution and use in source and binary forms, with or without modification, | 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,12 +40,13 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 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 | # CHANGELOG: | 44 | # CHANGELOG: |
| 47 | # 2012-09-17 v0.01 PL: - first version | 45 | # 2012-09-17 v0.01 PL: - first version |
| 48 | # 2012-10-04 v0.02 PL: - added license | 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 | # TODO: | 52 | # TODO: |
| @@ -93,7 +94,9 @@ def hexview_file (filename, msg='', title='ezhexviewer', length=16, startindex=0 | @@ -93,7 +94,9 @@ def hexview_file (filename, msg='', title='ezhexviewer', length=16, startindex=0 | ||
| 93 | hexview_data(data, msg=msg, title=title, length=length, startindex=startindex) | 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 | try: | 100 | try: |
| 98 | filename = sys.argv[1] | 101 | filename = sys.argv[1] |
| 99 | except: | 102 | except: |
| @@ -103,3 +106,7 @@ if __name__ == '__main__': | @@ -103,3 +106,7 @@ if __name__ == '__main__': | ||
| 103 | hexview_file(filename, msg='File: %s' % filename) | 106 | hexview_file(filename, msg='File: %s' % filename) |
| 104 | except: | 107 | except: |
| 105 | easygui.exceptionbox(msg='Error:', title='ezhexviewer') | 108 | easygui.exceptionbox(msg='Error:', title='ezhexviewer') |
| 109 | + | ||
| 110 | + | ||
| 111 | +if __name__ == '__main__': | ||
| 112 | + main() | ||
| 106 | \ No newline at end of file | 113 | \ No newline at end of file |