re_timerange = re_time + r'\s*-\s*' + re_time
re_timeranges = r'(' + re_timerange + r')(?:,(' + re_timerange + r'))*'
re_weekdays = r'(monday|tuesday|wednesday|thursday|friday|saturday|sunday)'
- re_isodate = r'(\d\d\d\d)-(0[1-9]|1[0-2])-([0-2][1-9]|3[01])'
+ re_isodate = r'(\d\d\d\d)-(0[1-9]|1[0-2])-([0-2][0-9]|3[01])'
re_monthname = r'(january|february|march|april|may|june|july|august|september|october|november|december)'
re_monthname_wd = r'(day|january|february|march|april|may|june|july|august|september|october|november|december)'
for file_name in files:
self.read_objectfile(file_name)
+ self.register_templates()
+ self.apply_tmplates()
+
pp = pprint.PrettyPrinter( indent = 4, depth = 6, width = 120 )
if self.verbose >= 3:
self.logger.debug( "Read objects:\n{0}".format( pp.pformat( self.objects_read ) ) )
del self.struct_verifier
- self.register_templates()
-
return
+ #------------------------------------------------------
+ def apply_tmplates( self ):
+ '''Apply definitions from templates (from 'use' declarations) into the object definitions in self.objects_read.
+ @return: None
+ @rtype: None
+ '''
+
+ pp = pprint.PrettyPrinter( indent = 4, depth = 6, width = 120 )
+ for object_type in self.objects_read:
+ for object in self.objects_read[object_type]:
+ object['templates'] = {}
+ object['templates_applied'] = set([])
+
#------------------------------------------------------
def register_templates( self ):
'''Searches the self.objects_read structure, searches for templates and registers them in self.templates