dataplot::__init__::GenericPlot Class Reference

List of all members.

Public Member Functions

def __init__
def get_plot_args
def __repr__
def prefix
def get_urls
def makefiles
def makedirs
def to_html
def to_html_thumb
def to_html_nolink
def render_html
def from_filename
def from_url
def get_filenames
def get_full_base
def convert
def do_chgrp
def do_chgrp_on
def get_app_dirs
def view

Static Public Attributes

 enable_caching = notsettings.DEBUG
 chgrp = None
 autosave = False
string convert_binary = 'convert'
string view_program = 'display'

Detailed Description

Singular representation of a plot for the web.

Subclasses need to define:

convert_to: dictionary that defines associated file suffixes, i.e.
convert_to={
    'png':{'suffix':'.png'},
    'thumb':{'suffix':'-thumb.png','convert_args':'-resize 65x90'},
    'pdf':{'suffix':'.pdf'},
    }
    
convert_from: one of the keys from convert_to, which specifies
which of the files is created by the makefile method.

makefile: a method that creates the image specified by
convert_from on the filesystem.

Definition at line 15 of file __init__.py.


Member Function Documentation

def dataplot::__init__::GenericPlot::__init__   self,
  basename,
  tocall,
  kwargs
 

Make a new plot to display.

Required args: (no sensible defaults)

basename: basename of this plot (no .pdf)
tocall: makes data dict to pass to the function for plotmaking.

Other plot parameters may be specified after instantiation as
attributes:

enable_caching: should the image be remade every time?
chgrp: group to set write permissions for

Definition at line 28 of file __init__.py.

def dataplot::__init__::GenericPlot::__repr__   self  ) 
 

Definition at line 68 of file __init__.py.

def dataplot::__init__::GenericPlot::convert   self  ) 
 

Convert from PDF to other formats using ImageMagick.

Definition at line 177 of file __init__.py.

def dataplot::__init__::GenericPlot::do_chgrp   self  ) 
 

Change group write perms if requested.

This is useful if your testing and production webservers have
different users but share the same media directory.

Definition at line 195 of file __init__.py.

def dataplot::__init__::GenericPlot::do_chgrp_on   self,
  fn
 

Definition at line 206 of file __init__.py.

def dataplot::__init__::GenericPlot::from_filename   self  ) 
 

Definition at line 161 of file __init__.py.

def dataplot::__init__::GenericPlot::from_url   self  ) 
 

Definition at line 164 of file __init__.py.

def dataplot::__init__::GenericPlot::get_app_dirs   self  ) 
 

Dig through settings.INSTALLED_APPS for full paths.

Definition at line 211 of file __init__.py.

def dataplot::__init__::GenericPlot::get_filenames   self  ) 
 

Return dictionary of image filenames.

Definition at line 167 of file __init__.py.

def dataplot::__init__::GenericPlot::get_full_base   self  ) 
 

Definition at line 173 of file __init__.py.

def dataplot::__init__::GenericPlot::get_plot_args   self  ) 
 

Gather input data from defaults and return value of tocall.

1. defaults for this plot type
2. returned arguments from get_plot_args

Definition at line 48 of file __init__.py.

def dataplot::__init__::GenericPlot::get_urls   self  ) 
 

Return dictionary of image URLs.

Make the plot if it doesn't exist or caching is off.

Definition at line 84 of file __init__.py.

def dataplot::__init__::GenericPlot::makedirs   self  ) 
 

Make subdirectories of media/ for this plot.

Definition at line 113 of file __init__.py.

def dataplot::__init__::GenericPlot::makefiles   self  ) 
 

Make initial file and conversions.

makefile() just makes the initial file.

Definition at line 102 of file __init__.py.

def dataplot::__init__::GenericPlot::prefix   self,
  pre
 

Generalized form of url/filename reporting.

pre: prefix to attach to the basename and suffix.

Definition at line 75 of file __init__.py.

def dataplot::__init__::GenericPlot::render_html   self,
  tfile
 

Render a HTML template with self as context 'plot'.

Definition at line 141 of file __init__.py.

def dataplot::__init__::GenericPlot::to_html   self  ) 
 

Render the PNG image and link to the PDF.

Definition at line 123 of file __init__.py.

def dataplot::__init__::GenericPlot::to_html_nolink   self  ) 
 

Render the PNG without link to PDF.

Definition at line 135 of file __init__.py.

def dataplot::__init__::GenericPlot::to_html_thumb   self  ) 
 

Render the PNG thumb.

Definition at line 129 of file __init__.py.

def dataplot::__init__::GenericPlot::view   self  ) 
 

Use some other program to look at rendered source image.

Will make the source image if it does not exist yet.

Definition at line 219 of file __init__.py.


Member Data Documentation

dataplot::__init__::GenericPlot::autosave = False [static]
 

Definition at line 23 of file __init__.py.

dataplot::__init__::GenericPlot::chgrp = None [static]
 

Definition at line 22 of file __init__.py.

string dataplot::__init__::GenericPlot::convert_binary = 'convert' [static]
 

Definition at line 25 of file __init__.py.

dataplot::__init__::GenericPlot::enable_caching = notsettings.DEBUG [static]
 

Definition at line 21 of file __init__.py.

string dataplot::__init__::GenericPlot::view_program = 'display' [static]
 

Definition at line 26 of file __init__.py.


The documentation for this class was generated from the following file:
Generated on Tue Apr 22 23:16:23 2008 for django-dataplot by  doxygen 1.4.6