Index: cms/sources.py |
=================================================================== |
--- a/cms/sources.py |
+++ b/cms/sources.py |
@@ -119,34 +119,34 @@ |
default_locale = self.read_config().get('general', 'defaultlocale') |
return filter(lambda f: os.path.splitext(f)[1].lower() != '.json', |
self.list_files('locales/%s' % default_locale)) |
def has_localizable_file(self, locale, filename): |
return self.has_file(self.localizable_file_filename(locale, filename)) |
def read_localizable_file(self, locale, filename): |
- return self.read_file(self.localizable_file_filename(locale, filename), binary=True)[0] |
+ return self.read_file(self.localizable_file_filename(locale, filename), True)[0] |
Vasily Kuznetsov
2018/09/25 12:31:33
Our memoize function can't deal with keyword param
|
# |
# Static file helpers |
# |
@staticmethod |
def static_filename(filename): |
return 'static/%s' % filename |
def list_static(self): |
return self.list_files('static') |
def has_static(self, filename): |
return self.has_file(self.static_filename(filename)) |
def read_static(self, filename): |
- return self.read_file(self.static_filename(filename), binary=True)[0] |
+ return self.read_file(self.static_filename(filename), True)[0] |
# |
# Locale helpers |
# |
def locale_filename(self, locale, page): |
config = self.read_config() |
try: |
@@ -389,18 +389,21 @@ |
additional_sources = [ |
create_source(os.path.join(path, p)) |
for p in additional_paths |
] |
source = MultiSource([source] + additional_sources) |
if cached: |
for fname in [ |
+ 'list_files', |
+ 'list_locales', |
'resolve_link', |
'read_config', |
'read_template', |
'read_locale', |
+ 'read_file', |
'read_include', |
'exec_file', |
]: |
setattr(source, fname, _memoize(getattr(source, fname))) |
return source |