Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SVCS-528] Improve gdoc rendering - MFR Part #303

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions mfr/server/handlers/core.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import os
import abc
import uuid
import asyncio
import os
import pkg_resources
import uuid

from raven.contrib.tornado import SentryMixin
import tornado.web
import tornado.iostream
from raven.contrib.tornado import SentryMixin

import waterbutler.core.exceptions
import waterbutler.core.utils
import waterbutler.server.utils
import waterbutler.core.exceptions

from mfr.server import settings
from mfr.core.metrics import MetricsRecord
from mfr.core import utils, exceptions, remote_logging
from mfr.core.metrics import MetricsRecord
from mfr.server import settings

CORS_ACCEPT_HEADERS = [
'Range',
Expand Down Expand Up @@ -97,13 +97,15 @@ def NAME(self):

async def prepare(self):
"""Builds an MFR provider instance, to which it passes the the ``url`` query parameter.
From that, the file metadata is extracted. Also builds cached waterbutler providers.
From that, the file metadata is extracted. Also builds cached waterbutler providers.
"""

if self.request.method == 'OPTIONS':
return

try:
self.url = self.request.query_arguments['url'][0].decode('utf-8')
# retrieve the url from request query parameter and append `&mfr=ture`
self.url = self.request.query_arguments['url'][0].decode('utf-8') + '&mfr=true'
except KeyError:
raise exceptions.ProviderError(
'"url" is a required argument.',
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def parse_requirements(requirements):
'mfr.exporters': [
# google docs
'.gdraw = mfr.extensions.image:ImageExporter',
'.gdoc = mfr.extensions.unoconv:UnoconvExporter',
'.gsheet = mfr.extensions.unoconv:UnoconvExporter',
'.gslides = mfr.extensions.unoconv:UnoconvExporter',

Expand Down Expand Up @@ -660,7 +659,6 @@ def parse_requirements(requirements):

# google docs
'.gdraw = mfr.extensions.image:ImageRenderer',
'.gdoc = mfr.extensions.unoconv:UnoconvRenderer',
'.gsheet = mfr.extensions.tabular:TabularRenderer',
'.gslides = mfr.extensions.unoconv:UnoconvRenderer',

Expand Down Expand Up @@ -693,6 +691,7 @@ def parse_requirements(requirements):

# pdf
'.pdf = mfr.extensions.pdf:PdfRenderer',
'.gdoc = mfr.extensions.pdf:PdfRenderer',

# rst
'.rst = mfr.extensions.rst:RstRenderer',
Expand Down