Skip to content

Commit

Permalink
Made pyatasm an optional package
Browse files Browse the repository at this point in the history
  • Loading branch information
robmcmullen committed Nov 22, 2016
1 parent 14a7d12 commit 3a24d30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions omnivore/tasks/jumpman/jumpman_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ def compile_assembly_source(self, show_info=False):
except SyntaxError, e:
log.error("Assembly error: %s" % e.msg)
self.window.error(e.msg, "Assembly Error")
except ImportError:
log.error("Please install pyatasm to compile custom code.")
self.assembly_source = ""
self.old_trigger_mapping = dict()
self.update_trigger_mapping()
if show_info:
dlg = wx.lib.dialogs.ScrolledMessageDialog(self.window.control, self.custom_code.info, "Assembly Results")
Expand Down
4 changes: 2 additions & 2 deletions omnivore/utils/jumpman.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import numpy as np

from pyatasm import Assemble

from atrcopy import selected_bit_mask, match_bit_mask, data_bit_mask, comment_bit_mask

from omnivore.utils.runtime import get_all_subclasses
Expand Down Expand Up @@ -995,6 +993,8 @@ class JumpmanCustomCode(object):
std_gameloop = [ord(x) for x in " \xd0I \x00K\xad>(\xc9\x00\xf0\x11\xad\xbe0\xc9\x08\x90\xef\xad\xf00\xc9\xff\xd0\xe5L?(lD("]

def __init__(self, filename):
# raise ImportError and let caller handle it
from pyatasm import Assemble
asm = Assemble(filename)
if not asm:
raise SyntaxError(asm.errors)
Expand Down

0 comments on commit 3a24d30

Please sign in to comment.