#NEWLINE# def _ask_default( self ) : #NEWLINE# #INDENT# print ( 'Please enter the default value now, as valid Python' ) #NEWLINE# print ( 'The datetime and django.utils.timezone modules are available, so you can do e.g. timezone.now' ) #NEWLINE# while True : #NEWLINE# #INDENT# if six . PY3 : #NEWLINE# #INDENT# code = input ( '>>> ' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# code = input ( '>>> ' ) . decode ( sys . stdin . encoding ) #NEWLINE# #UNINDENT# if ( not code ) : #NEWLINE# #INDENT# print ( "Please enter some code, or 'exit' (with no quotes) to exit." ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( code == 'exit' ) : #NEWLINE# #INDENT# sys . exit ( 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return eval ( code , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'datetime' : datetime_safe , #NEWLINE# 'timezone' : timezone , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# except ( SyntaxError , NameError ) as e : #NEWLINE# #INDENT# print ( ( 'Invalid input: %s' % e ) )