parameters: (self, filepath=None,
                        is_ptstops=True, is_poly=False,
                        encoding='UTF-8')
return_statement: return filepath
docstring: Export additional file
docstring_summary: Export additional file
docstring_tokens: Export additional file
function: def export_addxml(self, filepath=None,
                        is_ptstops=True, is_poly=False,
                        encoding='UTF-8'):
          """
          Export additional file
          """
          if filepath is None:
              filepath = self.get_addfilepath()
  
          try:
              fd = open(filepath, 'w')
  
          except:
              print 'WARNING in write_obj_to_xml: could not open', filepath
              return False
  
          #xmltag, xmltag_item, attrname_id = self.xmltag
          fd.write('<?xml version="1.0" encoding="%s"?>\n' % encoding)
          indent = 0
          #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/routes_file.xsd"',indent))
  
          fd.write(xm.begin('additional', indent))
  
          if is_ptstops:
              if len(self.ptstops) > 0:
                  self.ptstops.write_xml(fd, indent=indent+2)
  
          if is_poly:
              if self.parent is not None:
                  facilities = self.parent.landuse.facilities
                  if len(facilities) > 0:
                      fd.write(xm.start('location', indent+2))
                      # print '  groups:',self.parent.net.get_attrsman().get_groups()
                      for attrconfig in self.get_attrsman().get_group('location'):
                          # print '    locationconfig',attrconfig.attrname
                          attrconfig.write_xml(fd)
                      fd.write(xm.stopit())
  
                      facilities.write_xml(fd, indent=indent+2, is_print_begin_end=False)
  
          fd.write(xm.end('additional', indent))
          fd.close()
          return filepath
function_tokens: def export_addxml ( self , filepath = None , is_ptstops = True , is_poly = False , encoding = 'UTF-8' ) : if filepath is None : filepath = self . get_addfilepath ( ) try : fd = open ( filepath , 'w' ) except : print 'WARNING in write_obj_to_xml: could not open' , filepath return False #xmltag, xmltag_item, attrname_id = self.xmltag fd . write ( '<?xml version="1.0" encoding="%s"?>\n' % encoding ) indent = 0 #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/routes_file.xsd"',indent)) fd . write ( xm . begin ( 'additional' , indent ) ) if is_ptstops : if len ( self . ptstops ) > 0 : self . ptstops . write_xml ( fd , indent = indent + 2 ) if is_poly : if self . parent is not None : facilities = self . parent . landuse . facilities if len ( facilities ) > 0 : fd . write ( xm . start ( 'location' , indent + 2 ) ) # print '  groups:',self.parent.net.get_attrsman().get_groups() for attrconfig in self . get_attrsman ( ) . get_group ( 'location' ) : # print '    locationconfig',attrconfig.attrname attrconfig . write_xml ( fd ) fd . write ( xm . stopit ( ) ) facilities . write_xml ( fd , indent = indent + 2 , is_print_begin_end = False ) fd . write ( xm . end ( 'additional' , indent ) ) fd . close ( ) return filepath