From 559b1787285a3952822d4164cfba5251cabbdfc7 Mon Sep 17 00:00:00 2001 From: cfreksen Date: Tue, 31 Oct 2017 20:03:16 +0100 Subject: [PATCH] Use a script in the bin folder to start the emulator. --- bin/llvm--emulator | 18 ++++++++++++++++++ llvm_emulator/emulator.py | 11 ++--------- 2 files changed, 20 insertions(+), 9 deletions(-) create mode 100755 bin/llvm--emulator mode change 100755 => 100644 llvm_emulator/emulator.py diff --git a/bin/llvm--emulator b/bin/llvm--emulator new file mode 100755 index 0000000..c4120be --- /dev/null +++ b/bin/llvm--emulator @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +"""Small script to run the emulator.""" + +from __future__ import print_function +import sys + + +def run_emulator(): + """Run the emulator.""" + if sys.version_info.major < 3: + print('You need Python 3 to run this emulator. Aborting...') + return + from llvm_emulator import emulator + emulator.main() + + +if __name__ == '__main__': + run_emulator() diff --git a/llvm_emulator/emulator.py b/llvm_emulator/emulator.py old mode 100755 new mode 100644 index a309b6a..84ef0d0 --- a/llvm_emulator/emulator.py +++ b/llvm_emulator/emulator.py @@ -1,11 +1,8 @@ -#!/usr/bin/env python3 - """ Main module of the program. -This module is the one that should be run, e.g.:: - - $ ./emulator.py +To start the application, call the main function. For the end user, +this is achieved by a script stored in the bin folder. """ @@ -47,7 +44,3 @@ def go_auto(path_to_file): def enter_interactive_mode(): print('TODO: Interactive mode has not been implemented yet. Sorry...') - - -if __name__ == '__main__': - main()