Exemple #1
0
 def _updatequerie(self,updatequeries):
     ''' setter for queries: set/update queries of a node with dict queries.
     '''
     if updatequeries:
         if self._queries is None:
             self._queries = updatequeries.copy()
         else:
             botslib.updateunlessset(self._queries,updatequeries)
Exemple #2
0
 def messagegrammarread(self,typeofgrammarfile='grammars'):
     ''' read grammar for a message/envelope.
     '''
     #read grammar for message.
     #starts with default values from grammar.py; values are overruled by envelope settings; values are overrules by messagetype setting.
     self.defmessage = grammar.grammarread(self.ta_info['editype'],self.ta_info['messagetype'],typeofgrammarfile)
     #write values from grammar to self.ta_info - unless these values are already set (eg by mappingscript)
     botslib.updateunlessset(self.ta_info,self.defmessage.syntax)
     if not self.ta_info['charset']:
         self.ta_info['charset'] = self.defmessage.syntax['charset']      #always use charset of edi file.
Exemple #3
0
 def messagegrammarread(self, typeofgrammarfile='grammars'):
     ''' read grammar for a message/envelope.
     '''
     #read grammar for message.
     #starts with default values from grammar.py; values are overruled by envelope settings; values are overrules by messagetype setting.
     self.defmessage = grammar.grammarread(self.ta_info['editype'],
                                           self.ta_info['messagetype'],
                                           typeofgrammarfile)
     #write values from grammar to self.ta_info - unless these values are already set (eg by mappingscript)
     botslib.updateunlessset(self.ta_info, self.defmessage.syntax)
     if not self.ta_info['charset']:
         self.ta_info['charset'] = self.defmessage.syntax[
             'charset']  #always use charset of edi file.
Exemple #4
0
 def outmessagegrammarread(self,editype,messagetype):
     ''' read the grammar for a out-message.
         try to read the topartner dependent grammar syntax.
     ''' 
     self.defmessage = grammar.grammarread(editype,messagetype)
     #~ print 'self.ta_info',self.ta_info
     #~ print 'self.defmessage.syntax',self.defmessage.syntax
     botslib.updateunlessset(self.ta_info,self.defmessage.syntax)    #write values from grammar to self.ta_info - unless these values are already set eg by mapping script
     if self.ta_info['topartner']:   #read syntax-file for partner dependent syntax
         try:
             partnersyntax = grammar.syntaxread('partners',editype,self.ta_info['topartner'])
             self.ta_info.update(partnersyntax.syntax) #partner syntax overrules!
         except ImportError:
             pass        #No partner specific syntax found (is not an error).
Exemple #5
0
 def messagegrammarread(self,typeofgrammarfile='grammars'):
     ''' read grammar for a message/envelope.
     '''
     self.defmessage = grammar.grammarread(self.ta_info['editype'],self.ta_info['messagetype'],typeofgrammarfile)
     #write values from grammar to self.ta_info - unless these values are already set (eg by mappingscript)
     botslib.updateunlessset(self.ta_info,self.defmessage.syntax)