Package sabx10 :: Package pdf_gen :: Module instructions
[hide private]
[frames] | no frames]

Module instructions

source code

Create the table data and orchestrate turning it into PDF files.

Functions [hide private]
(string,string,string,string)
_convert_turn(turn, segs)
Format a turn as a table item.
source code
(string,string,string,string)
_convert_stop(stop)
Format a stop as a table item.
source code
(string,string,string,string)
_convert_poi(poi)
Format a poi as a table item.
source code
list of (string,string,string,string)
_create_table_data(ride)
Create a list of data lines to generate the PDF table from.
source code
 
pdf_all_rides(xml_tree, out_dir, out_base)
Generate instruction PDF files for each ride in a rideset.
source code
Variables [hide private]
  __package__ = 'sabx10.pdf_gen'
Function Details [hide private]

_convert_turn(turn, segs)

source code 

Format a turn as a table item.

Landmark is either "Parking" or "T - #", with # being the turn index.

Distance is how far into the ride the turn occurs.

Description is the turn cue.

Length is the length of the segment turning on to, saying how long you stay on the road you're turning on to.

Parameters:
  • turn (Turn object) - Turn to process
  • segs (list of Segment) - segment list, to get Length from
Returns: (string,string,string,string)
tuple of (landmark, distance, description, length)

_convert_stop(stop)

source code 

Format a stop as a table item.

Landmark is "S - #", with # being the stop index.

Distance is how far into the ride the stop occurs.

Description is the stop description.

Length is filled with the stop type.

Parameters:
Returns: (string,string,string,string)
tuple of (landmark, distance, description, length)

_convert_poi(poi)

source code 

Format a poi as a table item.

Landmark is "P - #", with # being the poi index.

Distance is how far into the ride the poi occurs.

Description is the poi description.

Length is filled with the string "POI".

Parameters:
  • poi (Poi object) - Poi to process
Returns: (string,string,string,string)
tuple of (landmark, distance, description, length)

_create_table_data(ride)

source code 

Create a list of data lines to generate the PDF table from. The list is filled with the turns, stops, and pois for the given ride.

Parameters:
Returns: list of (string,string,string,string)
list of (landmark, distance, description, length)

pdf_all_rides(xml_tree, out_dir, out_base)

source code 

Generate instruction PDF files for each ride in a rideset.

Parameters:
  • xml_tree (ElementTree stuff) - ElementTree representation of a rideset
  • out_dir (string) - directory to write the PDF files to
  • out_base (string) - file name base for PDF files