Ejemplo n.º 1
0
def Display_Update_Factory_Name(t_factory):
    'Look up factory name.'
    if t_factory:
        #t_file = File_System.Load_File('t/0001-L044.xml')
        # Let the t-file Read handle the lookup.
        #return t_file.Read(t_factory)
        return File_System.Read_Text(t_factory)
    return
Ejemplo n.º 2
0
def Update_Description(t_descrip_entry, ):
    'Look up a text reference description.'
    if not t_descrip_entry:
        return ''
    else:
        #t_file = File_System.Load_File('t/0001-L044.xml')
        # Let the t-file Read handle the lookup.
        #return t_file.Read(t_descrip_entry)
        return File_System.Read_Text(t_descrip_entry)
Ejemplo n.º 3
0
def Display_Update_Ware_Name(t_name_entry, id):
    'Look up ware name.'
    # If no t_name_entry available, use the id name.
    if not t_name_entry:
        return id
    else:
        #t_file = File_System.Load_File('t/0001-L044.xml')
        # Let the t-file Read handle the lookup.
        #name = t_file.Read(t_name_entry)
        name = File_System.Read_Text(t_name_entry)
        return name
Ejemplo n.º 4
0
 def Get_Game_Name(self):
     '''
     Return the in-game name of this macro, defaulting to the macro
     name if not found.
     '''
     if not hasattr(self, '_game_name'):
         # Default to macro name.
         self._game_name = self.name
         # Check for idenfication/name.
         ident_node = self.xml_node.find('./properties/identification')
         if ident_node != None:
             name_code = ident_node.get('name')
             if name_code:
                 self._game_name = File_System.Read_Text(name_code)
     return self._game_name
Ejemplo n.º 5
0
def Update_Name(t_name_entry, codename):
    'Look up a text reference name.'
    if not t_name_entry:
        # If no t_name_entry available, use the codename name.
        # Component could be used sometimes, since it often is the codename
        #  without a _macro suffix, but doesn't work quite as well
        #  since sometimes objects will share a component (causing them
        #  to have the same name).
        # This will manually prune the _macro term if found.
        return codename.replace('_macro', '')
    else:
        #t_file = File_System.Load_File('t/0001-L044.xml')
        #name = t_file.Read(t_name_entry)
        # Let the t-file Read handle the lookup.
        name = File_System.Read_Text(t_name_entry)
        # TODO: maybe replace with something when the name is blank.
        return name