def __init__(self, session, config, parent): AccumulatingDocumentFactory.__init__(self, session, config, parent) # text to use as header and footer plus switch for columns or not self.headerString = self.get_setting(session, 'header', None) self.footerString = self.get_setting(session, 'footer', None) self.columns = int(self.get_setting(session, 'columns', 0)) #font crap #psfont can either be helvetica (default), courier or times-roman #TTfonts need to be installed on the system and all 4 font types need to be specified with a path to their installed location (needed for some obscure accented characters outside - Latin 1 and 2 I think) self.psfont = self.get_setting(session, 'psfont', 'helvetica') self.ttfontNormal = self.get_setting(session, 'ttfontNormal', None) self.ttfontBold = self.get_setting(session, 'ttfontBold', None) self.ttfontItalic = self.get_setting(session, 'ttfontItalic', None) self.ttfontBoldItalic = self.get_setting(session, 'ttfontBoldItalic', None) if self.ttfontNormal != None: self.normaltag = self.ttfontNormal[self.ttfontNormal.rfind('/')+1:self.ttfontNormal.rfind('.')] self.boldtag = self.ttfontBold[self.ttfontBold.rfind('/')+1:self.ttfontBold.rfind('.')] self.italictag = self.ttfontItalic[self.ttfontItalic.rfind('/')+1:self.ttfontItalic.rfind('.')] self.bolditalictag = self.ttfontBoldItalic[self.ttfontBoldItalic.rfind('/')+1:self.ttfontBoldItalic.rfind('.')] pdfmetrics.registerFont(TTFont(self.normaltag, self.ttfontNormal)) pdfmetrics.registerFont(TTFont(self.boldtag, self.ttfontBold)) pdfmetrics.registerFont(TTFont(self.italictag, self.ttfontItalic)) pdfmetrics.registerFont(TTFont(self.bolditalictag, self.ttfontBoldItalic)) registerFontFamily(self.normaltag,normal=self.normaltag,bold=self.boldtag,italic=self.italictag,boldItalic=self.bolditalictag) ParagraphStyle.fontName = self.normaltag else: ParagraphStyle.fontName = self.psfont
def __init__(self, session, config, parent): AccumulatingDocumentFactory.__init__(self, session, config, parent) # text to use as header and footer plus switch for columns or not self.headerString = self.get_setting(session, 'header', None) self.footerString = self.get_setting(session, 'footer', None) self.columns = int(self.get_setting(session, 'columns', 0)) #font crap #psfont can either be helvetica (default), courier or times-roman #TTfonts need to be installed on the system and all 4 font types need to be specified with a path to their installed location (needed for some obscure accented characters outside - Latin 1 and 2 I think) self.psfont = self.get_setting(session, 'psfont', 'helvetica') self.ttfontNormal = self.get_setting(session, 'ttfontNormal', None) self.ttfontBold = self.get_setting(session, 'ttfontBold', None) self.ttfontItalic = self.get_setting(session, 'ttfontItalic', None) self.ttfontBoldItalic = self.get_setting(session, 'ttfontBoldItalic', None) if self.ttfontNormal is not None: self.normaltag = self.ttfontNormal[self.ttfontNormal.rfind('/')+1:self.ttfontNormal.rfind('.')] self.boldtag = self.ttfontBold[self.ttfontBold.rfind('/')+1:self.ttfontBold.rfind('.')] self.italictag = self.ttfontItalic[self.ttfontItalic.rfind('/')+1:self.ttfontItalic.rfind('.')] self.bolditalictag = self.ttfontBoldItalic[self.ttfontBoldItalic.rfind('/')+1:self.ttfontBoldItalic.rfind('.')] pdfmetrics.registerFont(TTFont(self.normaltag, self.ttfontNormal)) pdfmetrics.registerFont(TTFont(self.boldtag, self.ttfontBold)) pdfmetrics.registerFont(TTFont(self.italictag, self.ttfontItalic)) pdfmetrics.registerFont(TTFont(self.bolditalictag, self.ttfontBoldItalic)) registerFontFamily(self.normaltag,normal=self.normaltag,bold=self.boldtag,italic=self.italictag,boldItalic=self.bolditalictag) ParagraphStyle.fontName = self.normaltag else: ParagraphStyle.fontName = self.psfont
__all__ = ['srwExtensions'] import cheshire3.web.srwExtensions from cheshire3.documentFactory import SimpleDocumentFactory, AccumulatingDocumentFactory from cheshire3.queryFactory import SimpleQueryFactory from cheshire3.web.documentFactory import streamHash, accStreamHash from cheshire3.web.queryFactory import streamHash as qStreams # Register web sub-package streams base Factories # DocumentStreams for (k, v) in streamHash.items(): # register_stream is an @classmethod SimpleDocumentFactory.register_stream(k, v) # AccumulatingDocumentStreams for (k, v) in accStreamHash.items(): # register_stream is an @classmethod AccumulatingDocumentFactory.register_stream(k, v) # QueryStreams for format, cls in qStreams.iteritems(): # register_stream is an @classmethod SimpleQueryFactory.register_stream(format, cls)
__all__ = ['srwExtensions'] import cheshire3.web.srwExtensions from cheshire3.documentFactory import SimpleDocumentFactory, AccumulatingDocumentFactory from cheshire3.queryFactory import SimpleQueryFactory from cheshire3.web.documentFactory import streamHash, accStreamHash from cheshire3.web.queryFactory import streamHash as qStreams # Register web sub-package streams base Factories # DocumentStreams for (k,v) in streamHash.items(): # register_stream is an @classmethod SimpleDocumentFactory.register_stream(k, v) # AccumulatingDocumentStreams for (k,v) in accStreamHash.items(): # register_stream is an @classmethod AccumulatingDocumentFactory.register_stream(k, v) # QueryStreams for format, cls in qStreams.iteritems(): # register_stream is an @classmethod SimpleQueryFactory.register_stream(format, cls)