Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgimenez committed Nov 24, 2016
1 parent 68f742f commit c9f5fec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions src/rapido/plone/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from zope.component import queryUtility
from zope.interface import implements
from zope.pagetemplate.pagetemplate import PageTemplate
from zExceptions import NotFound

from rapido.core import exceptions
from rapido.core.app import Context
Expand Down Expand Up @@ -94,11 +93,16 @@ def get_block(self, block_id, ftype='yaml'):
else:
raise KeyError('%s.%s' % (block_id, ftype))

def get_resource_directory(self):
def get_resource_directory(self, name=None):
directory = get_theme_directory()
try:
if not directory.isDirectory('rapido'):
raise exceptions.NotFound(self.id)
if directory['rapido'].isDirectory(self.id):
return directory['rapido'][self.id]
except NotFound:
elif directory['rapido'].isFile(self.id + '.lnk'):
directory_name = directory['rapido'].readFile(self.id + '.lnk')
return self.get_resource_directory(name=directory_name)
else:
raise exceptions.NotFound(self.id)

def get_resource(self, path):
Expand Down Expand Up @@ -155,6 +159,6 @@ def get_app(app_id, request, content=None):
return IRapidoApplication(app)


def get_theme_directory():
theme = getCurrentTheme()
return queryResourceDirectory(THEME_RESOURCE_NAME, theme)
def get_theme_directory(name=None):
return queryResourceDirectory(
THEME_RESOURCE_NAME, name or getCurrentTheme())
2 changes: 1 addition & 1 deletion src/rapido/plone/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def process_yaml(path, yaml_content):
path = path.rpartition('.')[0]
view = get_block_view(path, with_theme)
provideAdapter(view, (Interface, IBrowserRequest),
Interface, name=id)
Interface, name=id)

if HAS_MOSAIC and 'tile' in yaml_settings:
id = path[-1].rpartition('.')[0]
Expand Down

0 comments on commit c9f5fec

Please sign in to comment.