예제 #1
0
    def _processIfActive(self):
        tz = timezoneUtils.DisplayTZ(self._aw, self._conf).getDisplayTZ()
        cfaMgr = self._conf.getAbstractMgr()
        abstracts = cfaMgr.getAbstractListForAvatar(self._aw.getUser())
        abstracts += cfaMgr.getAbstractListForAuthorEmail(self._aw.getUser().getEmail())
        self._abstractIds = [abstract.getId() for abstract in abstracts]
        if not self._abstractIds:
            return _("No abstract to print")

        pdf = AbstractsToPDF(self._conf, self._abstractIds, tz=tz)
        return send_file("my-abstracts.pdf", StringIO(pdf.getPDFBin()), "PDF")
예제 #2
0
    def _processIfActive(self):
        tz = timezoneUtils.DisplayTZ(self._aw, self._conf).getDisplayTZ()
        cfaMgr = self._conf.getAbstractMgr()
        abstracts = set(cfaMgr.getAbstractListForAvatar(self._aw.getUser()))
        abstracts |= set(cfaMgr.getAbstractListForAuthorEmail(self._aw.getUser().getEmail()))
        self._abstractIds = sorted(abstract.getId() for abstract in abstracts)
        if not self._abstractIds:
            return _("No abstract to print")

        filename = 'my-abstracts.pdf'
        pdf = AbstractsToPDF(self._conf, self._abstractIds, tz=tz)
        return send_file(filename, pdf.generate(), 'PDF')
예제 #3
0
 def _process( self ):  
     tz = timezoneUtils.DisplayTZ(self._aw,self._conf).getDisplayTZ()      
     filename = "Abstracts.pdf"
     if not self._abstracts:
         return _("No abstract to print")
     pdf = AbstractsToPDF(self._conf, self._abstracts,tz=tz)
     data = pdf.getPDFBin()
     self._req.set_content_length(len(data))
     cfg = Config.getInstance()
     mimetype = cfg.getFileTypeMimeType( "PDF" )
     self._req.content_type = """%s"""%(mimetype)
     self._req.headers_out["Content-Disposition"] = """inline; filename="%s\""""%filename
     return data
예제 #4
0
    def _processIfActive(self):
        tz = timezoneUtils.DisplayTZ(self._aw, self._conf).getDisplayTZ()
        cfaMgr = self._conf.getAbstractMgr()
        abstracts = set(cfaMgr.getAbstractListForAvatar(self._aw.getUser()))
        abstracts |= set(
            cfaMgr.getAbstractListForAuthorEmail(
                self._aw.getUser().getEmail()))
        self._abstractIds = sorted(abstract.getId() for abstract in abstracts)
        if not self._abstractIds:
            return _("No abstract to print")

        filename = 'my-abstracts.pdf'
        pdf = AbstractsToPDF(self._conf, self._abstractIds, tz=tz)
        return send_file(filename, pdf.generate(), 'PDF')
예제 #5
0
 def _process(self):
     tz = timezoneUtils.DisplayTZ(self._aw, self._conf).getDisplayTZ()
     filename = "Abstracts.pdf"
     if not self._abstracts:
         return _("No abstract to print")
     pdf = AbstractsToPDF(self._conf, self._abstracts, tz=tz)
     data = pdf.getPDFBin()
     self._req.set_content_length(len(data))
     cfg = Config.getInstance()
     mimetype = cfg.getFileTypeMimeType("PDF")
     self._req.content_type = """%s""" % (mimetype)
     self._req.headers_out[
         "Content-Disposition"] = """inline; filename="%s\"""" % filename
     return data
예제 #6
0
    def _processIfActive( self ):
        tz = timezoneUtils.DisplayTZ(self._aw,self._conf).getDisplayTZ()
        cfaMgr = self._conf.getAbstractMgr()
        abstracts = cfaMgr.getAbstractListForAvatar( self._aw.getUser() )
        abstracts += cfaMgr.getAbstractListForAuthorEmail(self._aw.getUser().getEmail())
        self._abstractIds = [abstract.getId() for abstract in abstracts]
        if not self._abstractIds:
            return _("No abstract to print")

        filename = "Abstracts.pdf"
        pdf = AbstractsToPDF(self._conf, self._abstractIds,tz=tz)
        data = pdf.getPDFBin()
        self._req.set_content_length(len(data))
        cfg = Config.getInstance()
        mimetype = cfg.getFileTypeMimeType( "PDF" )
        self._req.content_type = """%s"""%(mimetype)
        self._req.headers_out["Content-Disposition"] = """inline; filename=%s"""%filename
        return data
예제 #7
0
    def _processIfActive( self ):
        tz = timezoneUtils.DisplayTZ(self._aw,self._conf).getDisplayTZ()
        cfaMgr = self._conf.getAbstractMgr()
        abstracts = cfaMgr.getAbstractListForAvatar( self._aw.getUser() )
        abstracts += cfaMgr.getAbstractListForAuthorEmail(self._aw.getUser().getEmail())
        self._abstractIds = [abstract.getId() for abstract in abstracts]
        if not self._abstractIds:
            return _("No abstract to print")

        filename = "Abstracts.pdf"
        pdf = AbstractsToPDF(self._conf, self._abstractIds,tz=tz)
        data = pdf.getPDFBin()
        self._req.set_content_length(len(data))
        cfg = Config.getInstance()
        mimetype = cfg.getFileTypeMimeType( "PDF" )
        self._req.content_type = """%s"""%(mimetype)
        self._req.headers_out["Content-Disposition"] = """inline; filename="%s\""""%filename
        return data
예제 #8
0
파일: display.py 프로젝트: nyimbi/indico
 def _process(self):
     pdf = AbstractsToPDF(self.event_new,
                          get_user_abstracts(self.event_new, session.user))
     return send_file('my-abstracts.pdf', pdf.generate(), 'application/pdf')
예제 #9
0
파일: display.py 프로젝트: OmeGak/indico
 def _process(self):
     pdf = AbstractsToPDF(self.event_new, get_user_abstracts(self.event_new, session.user))
     return send_file('my-abstracts.pdf', pdf.generate(), 'application/pdf')