Package sabx10 :: Package utils :: Module sabx_cleanup :: Class CleanupProcessor
[hide private]
[frames] | no frames]

Class CleanupProcessor

source code

                          object --+        
                                   |        
templating.generic.TemplateProcessor --+    
                                       |    
           templating.sabx.SabxProcessor --+
                                           |
                                          CleanupProcessor

Process an SABX 1.0 file and remove all unused parking places, turns, segments, stops, and pois.

Instance Methods [hide private]
 
_get_used_item_ids(self)
Go through all the rides in the rideset and make lists of all parking places, turns, segments, stops, and pois that are used.
source code
(list, dict) of used objects
_get_used_items(self, old_list, used_ids)
Go through items in the old_list and make a new list and dict containing the items whose ids are in used_ids.
source code
 
_cull_unused_items(self)
Go through the lists of parking places, turns, segments, stops, and pois and only keeps items that are used in rides.
source code
 
get_template_data(self)
Culls unused items from the SABX 1.0 data.
source code

Inherited from templating.sabx.SabxProcessor: __init__, process_template

Inherited from templating.generic.TemplateProcessor: process, process_options

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
list of string used_parking_ids
list of parking place ids used in rides
list of string used_poi_ids
list of poi ids used in rides
list of string used_seg_ids
list of segment ids used in rides
list of string used_stop_ids
list of stop ids used in rides
list of string used_turn_ids
list of turn ids used in rides

Inherited from templating.sabx.SabxProcessor: in_file, sabx

Inherited from templating.generic.TemplateProcessor: args, man, options, out_file, parser, template_data, template_file, template_path

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_get_used_items(self, old_list, used_ids)

source code 

Go through items in the old_list and make a new list and dict containing the items whose ids are in used_ids.

Parameters:
  • old_list (list of objects) - list of items to check
  • used_ids (list of string) - list of ids to check against
Returns: (list, dict) of used objects
list and dict of used items

get_template_data(self)

source code 

Culls unused items from the SABX 1.0 data.

Overrides: templating.generic.TemplateProcessor.get_template_data