#NEWLINE# def insert_order( self , module , key , num = None , is_parent_parser = False ) : #NEWLINE# #INDENT# retval = False #NEWLINE# search_key = [ ] #NEWLINE# if ( type ( key ) == list ) : #NEWLINE# #INDENT# if ( is_parent_parser is True ) : #NEWLINE# #INDENT# _sk = key . pop ( 0 ) #NEWLINE# search_key . append ( _sk ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( type ( key ) == str ) : #NEWLINE# #INDENT# key = [ key ] #NEWLINE# #UNINDENT# #UNINDENT# search_key . append ( self . orders_key ) #NEWLINE# try : #NEWLINE# #INDENT# orders = self . get ( module , search_key ) #NEWLINE# if ( key in orders ) : #NEWLINE# #INDENT# return orders . index ( key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( num is None ) : #NEWLINE# #INDENT# num = len ( orders ) #NEWLINE# #UNINDENT# orders . insert ( num , key ) #NEWLINE# self . set ( module , search_key , orders ) #NEWLINE# retval = num #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# self . set ( module , search_key , [ key ] ) #NEWLINE# retval = 0 #NEWLINE# pass #NEWLINE# #UNINDENT# return retval