Commits

Jason R. Coombs committed 4c0b6fa

Use the EggmonsterApplication class for manipulating package/app names (less error-prone).

  • Participants
  • Parent commits 6eb0d92

Comments (0)

Files changed (1)

eggmonster/spawn.py

 import eggmonster.runner
 
 
-def construct_fake_monster_command(entry_point, exec_args, args):
+def construct_fake_monster_command(app_name, exec_args, args):
     """
-    Construct a command to launch the app named by 'entry_point' with
-    args.
+    Construct a command to launch the app named `app_name` in the same
+    package as this FakeMonster app, but with `args`.
     """
     em_app, config_path = eggmonster.runner.FakeMonster.parse_args()
-    em_app = '%s.%s' % (str(em_app).split('.', 1)[0], entry_point)
+    em_app.name = app_name
 
-    res = [exec_args[0], '--config-path=%s' % config_path, em_app]
-    res.extend(args)
-    return res
+    command = [exec_args[0], '--config-path', config_path, str(em_app)]
+    command.extend(args)
+    return command
 
 def construct_monster_run_command(entry_point, exec_args, args):