Package sabx10 :: Package profiles :: Module profiles_pdf
[hide private]
[frames] | no frames]

Module profiles_pdf

source code

Use Reportlab and the Image library to convert a profile PNG file into a PDF file. We only bother with the large profiles.

Functions [hide private]
 
_large_profile_to_pdf(title, ride, in_dir, in_base, out_dir, out_base, seg_index='all')
Take the large PNG profile for a ride and convert it to a PDF file with the image embedded in it.
source code
 
ride_profiles_to_pdfs(xml_tree, prof_dir, prof_base, out_dir, out_base)
Convert the large overall profile for each ride in a rideset into a PDF file.
source code
Variables [hide private]
  __package__ = 'sabx10.profiles'
Function Details [hide private]

_large_profile_to_pdf(title, ride, in_dir, in_base, out_dir, out_base, seg_index='all')

source code 

Take the large PNG profile for a ride and convert it to a PDF file with the image embedded in it.

Parameters:
  • title (string) - title base for PDF file
  • ride (Ride object) - Ride object to generate PDF for
  • in_dir (string) - directory to find PNG file in
  • in_base (string) - base of name for PNG file
  • out_dir (string) - directory to put PDF file in
  • out_base (string) - base of name for PDF file
  • seg_index (string) - index of segment in ride to generate PDF for (default to all)

ride_profiles_to_pdfs(xml_tree, prof_dir, prof_base, out_dir, out_base)

source code 

Convert the large overall profile for each ride in a rideset into a PDF file.

Parameters:
  • xml_tree (ElementTree stuff) - ElementTree representation of a rideset
  • prof_dir (string) - directory containing the profile PNG files
  • prof_base (string) - base name for profile PNG file names
  • out_dir (string) - directory to put PDF files into
  • out_base (string) - base name for PDF files