Public Member Functions | Public Attributes | List of all members
galleryMaker.SavedFigure Class Reference

Public Member Functions

def __init__ (self, topic, thumbWebPath, caption, formats, docURL, docTitle, wrapperWebPath, wrapperPath, fileBaseName)
 
def makeWrapper (self)
 
def formatsBar (self)
 

Public Attributes

 topic
 
 thumbWebPath
 
 caption
 
 formats
 
 docURL
 
 docTitle
 
 wrapperWebPath
 
 wrapperPath
 
 fileBaseName
 

Detailed Description

Definition at line 78 of file galleryMaker.py.

Constructor & Destructor Documentation

def galleryMaker.SavedFigure.__init__ (   self,
  topic,
  thumbWebPath,
  caption,
  formats,
  docURL,
  docTitle,
  wrapperWebPath,
  wrapperPath,
  fileBaseName 
)

Definition at line 79 of file galleryMaker.py.

79  def __init__(self, topic, thumbWebPath, caption, formats, docURL, docTitle, wrapperWebPath, wrapperPath, fileBaseName):
80  self.topic = topic # Name of docdb topic
81  self.thumbWebPath = thumbWebPath # Location of thumbnail relative to web dir
82  self.caption = caption # Caption from gallery
83  self.formats = formats # list of FileNBEs
84  self.docURL = docURL # URL of docdb entry
85  self.docTitle = docTitle # Title of docdb entry
86  self.wrapperWebPath = wrapperWebPath # Location of wrapper relative to web dir
87  self.wrapperPath = wrapperPath # Location of wrapper relative to root of filesystem
88  self.fileBaseName = fileBaseName # Location of wrapper relative to root of filesystem
89 
def __init__(self, topic, thumbWebPath, caption, formats, docURL, docTitle, wrapperWebPath, wrapperPath, fileBaseName)
Definition: galleryMaker.py:79

Member Function Documentation

def galleryMaker.SavedFigure.formatsBar (   self)

Definition at line 107 of file galleryMaker.py.

References galleryMaker.SavedFigure.docURL, galleryMaker.SavedFigure.formats, and galleryMaker.link().

Referenced by galleryMaker.SavedFigure.makeWrapper().

107  def formatsBar(self):
108  bar = ""
109  bar += ("[" + link("DocDB" , self.docURL) + "] " )
110 
111  for format in self.formats:
112  bar += ("[" + link(format.ext , format.url) + "] " )
113  return bar
114 
def link(text, url)
def galleryMaker.SavedFigure.makeWrapper (   self)

Definition at line 90 of file galleryMaker.py.

References Table.caption, bp_plot.Plot.caption, galleryMaker.SavedFigure.caption, galleryMaker.SavedFigure.docTitle, galleryMaker.SavedFigure.fileBaseName, galleryMaker.SavedFigure.formatsBar(), galleryMaker.heading1(), galleryMaker.heading2(), galleryMaker.hrule(), galleryMaker.paragraph(), galleryMaker.SavedFigure.thumbWebPath, and galleryMaker.SavedFigure.wrapperPath.

90  def makeWrapper(self):
91  wrapper = codecs.open(self.wrapperPath, 'w', 'utf-8')
92  wrapper.write(heading1(self.docTitle))
93  wrapper.write(heading2(self.fileBaseName))
94  wrapper.write(self.formatsBar())
95  wrapper.write(hrule())
96  wrapper.write(hendl)
97  wrapper.write(paragraph(self.caption, fullWidth))
98  wrapper.write('<img src=../"' + self.thumbWebPath + '" style="border-style: none" Title="'+fig.caption+'" />')
99  wrapper.write(hendl)
100  wrapper.write(self.formatsBar())
101  wrapper.write(paragraph("Disclaimer: this .png version of the image is for browsing purposes only. Please find the official versions of this plot through the links above.", fullWidth))
102 
103 
104  wrapper.close()
105 
106 
def heading1(str)
def paragraph(str, width=None)
def heading2(str)

Member Data Documentation

galleryMaker.SavedFigure.caption

Definition at line 82 of file galleryMaker.py.

Referenced by galleryMaker.SavedFigure.makeWrapper().

galleryMaker.SavedFigure.docTitle

Definition at line 85 of file galleryMaker.py.

Referenced by galleryMaker.SavedFigure.makeWrapper().

galleryMaker.SavedFigure.docURL

Definition at line 84 of file galleryMaker.py.

Referenced by galleryMaker.SavedFigure.formatsBar().

galleryMaker.SavedFigure.fileBaseName

Definition at line 88 of file galleryMaker.py.

Referenced by galleryMaker.SavedFigure.makeWrapper().

galleryMaker.SavedFigure.formats

Definition at line 83 of file galleryMaker.py.

Referenced by galleryMaker.SavedFigure.formatsBar().

galleryMaker.SavedFigure.thumbWebPath

Definition at line 81 of file galleryMaker.py.

Referenced by galleryMaker.SavedFigure.makeWrapper().

galleryMaker.SavedFigure.topic

Definition at line 80 of file galleryMaker.py.

galleryMaker.SavedFigure.wrapperPath

Definition at line 87 of file galleryMaker.py.

Referenced by galleryMaker.SavedFigure.makeWrapper().

galleryMaker.SavedFigure.wrapperWebPath

Definition at line 86 of file galleryMaker.py.


The documentation for this class was generated from the following file: