@@ -82,6 +82,10 @@ def run(self, line):
82
82
cmd = True
83
83
break
84
84
if cmd :
85
+ if self .command_name not in constants .NON_FUNCTIONAL_COMMANDS :
86
+ entry = self .current_level ()
87
+ if 'requires' in dir (entry ) and not entry .requires ():
88
+ self .fatal_error ("Missing requirements" )
85
89
utils .check_user_access (self .current_level ().name )
86
90
rv = self .execute_command () is not False
87
91
except (ValueError , IOError ) as e :
@@ -239,8 +243,7 @@ def previous_level(self):
239
243
def enter_level (self , level ):
240
244
'''
241
245
Pushes an instance of the given UILevel
242
- subclass onto self.stack. Checks prerequirements
243
- for the level (if any).
246
+ subclass onto self.stack.
244
247
'''
245
248
# on entering new level we need to set the
246
249
# interactive option _before_ creating the level
@@ -251,8 +254,6 @@ def enter_level(self, level):
251
254
self ._in_transit = True
252
255
253
256
entry = level ()
254
- if 'requires' in dir (entry ) and not entry .requires ():
255
- self .fatal_error ("Missing requirements" )
256
257
self .stack .append (entry )
257
258
self .clear_readline_cache ()
258
259
@@ -320,7 +321,8 @@ def up(self):
320
321
'''
321
322
ok = True
322
323
if len (self .stack ) > 1 :
323
- ok = self .current_level ().end_game (no_questions_asked = self ._in_transit ) is not False
324
+ if self .command_name and self .command_name not in constants .NON_FUNCTIONAL_COMMANDS :
325
+ ok = self .current_level ().end_game (no_questions_asked = self ._in_transit ) is not False
324
326
self .stack .pop ()
325
327
self .clear_readline_cache ()
326
328
return ok
@@ -341,7 +343,9 @@ def quit(self, rc=0):
341
343
'''
342
344
Exit from the top level
343
345
'''
344
- ok = self .current_level ().end_game ()
346
+ ok = True
347
+ if self .command_name and self .command_name not in constants .NON_FUNCTIONAL_COMMANDS :
348
+ ok = self .current_level ().end_game ()
345
349
if options .interactive and not options .batch :
346
350
if constants .need_reset :
347
351
utils .ext_cmd ("reset" )
0 commit comments