示例#1
0
 def __init__(self, book, server, bookname=None):
     if bookname is None:
         bookname = make_book_name(book, server, '.zip')
     log("*** Extracting TWiki book %s ***" % bookname)
     self.bookname = bookname
     self.book = book
     self.server = server
     self.workdir = tempfile.mkdtemp(prefix=bookname, dir=config.TMPDIR)
     os.chmod(self.workdir, 0755)
     #probable text direction
     self.dir = guess_text_dir(self.server, self.book)
示例#2
0
 def __init__(self, book, server, bookname=None):
     if bookname is None:
         bookname = make_book_name(book, server, '.zip')
     log("*** Extracting TWiki book %s ***" % bookname)
     self.bookname = bookname
     self.book = book
     self.server = server
     self.workdir = tempfile.mkdtemp(prefix=bookname, dir=config.TMPDIR)
     os.chmod(self.workdir, 0755)
     #probable text direction
     self.dir = guess_text_dir(self.server, self.book)
示例#3
0
文件: tasks.py 项目: jalal70/Objavi
    def __init__(self, args):
        self.bookid = args.get('book')
        self.server = args.get('server')
        self.mode = args.get('mode', form_config.DEFAULT_MODE)
        extension = form_config.CGI_MODES.get(self.mode)[1]
        self.bookname = book_utils.make_book_name(self.bookid, self.server, extension)
        self.destination = args.get('destination')
        self.callback = args.get('callback')
        self.method = args.get('method', form_config.CGI_DESTINATIONS[self.destination]['default'])
        self.template, self.mimetype = form_config.CGI_DESTINATIONS[self.destination][self.method]
        self.bookurl = "%s/%s" % (config.PUBLISH_URL, self.bookname,)

        if args.get('output_format') and args.get('output_profile'):
            self.bookurl = self.bookurl.rsplit(".", 1)[0]+"."+args.get('output_format')

        self.details_url, self.s3url = fmbook.find_archive_urls(self.bookid, self.bookname)
        self.booki_group = args.get('booki_group')
        self.booki_user = args.get('booki_user')
示例#4
0
文件: tasks.py 项目: fm-admin/Objavi
    def __init__(self, args):
        self.bookid = args.get('book')
        self.server = args.get('server')
        self.mode = args.get('mode', form_config.DEFAULT_MODE)
        extension = form_config.CGI_MODES.get(self.mode)[1]
        self.bookname = book_utils.make_book_name(self.bookid, self.server, extension)
        self.destination = args.get('destination')
        self.callback = args.get('callback')
        self.method = args.get('method', form_config.CGI_DESTINATIONS[self.destination]['default'])
        self.template, self.mimetype = form_config.CGI_DESTINATIONS[self.destination][self.method]
        self.bookurl = "%s/%s" % (config.PUBLISH_URL, self.bookname,)

        if args.get('output_format') and args.get('output_profile'):
            self.bookurl = self.bookurl.rsplit(".", 1)[0]+"."+args.get('output_format')

        self.details_url, self.s3url = fmbook.find_archive_urls(self.bookid, self.bookname)
        self.booki_group = args.get('booki_group')
        self.booki_user = args.get('booki_user')