Skip to content

Commit

Permalink
Fix locale functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
urschrei committed May 25, 2019
1 parent d0329d5 commit d24ed3b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pyzotero/zotero.py
Expand Up @@ -33,7 +33,7 @@
from __future__ import unicode_literals

__author__ = "Stephan Hügel"
__version__ = "1.4.0"
__version__ = "1.4.1"
__api_version__ = "3"

import sys
Expand Down Expand Up @@ -1028,7 +1028,7 @@ def check_items(self, items):
# now split up the URL
result = urlparse(r.url)
# construct cache key
cachekey = result.path + "," + result.query
cachekey = result.path + "_" + result.query
if self.templates.get(cachekey) and not self._updated(
query_string, self.templates[cachekey], cachekey
):
Expand Down Expand Up @@ -1084,7 +1084,7 @@ def item_types(self):
# now split up the URL
result = urlparse(r.url)
# construct cache key
cachekey = result.path + "," + result.query
cachekey = result.path + "_" + result.query
if self.templates.get(cachekey) and not self._updated(
query_string, self.templates[cachekey], cachekey
):
Expand All @@ -1104,7 +1104,7 @@ def creator_fields(self):
# now split up the URL
result = urlparse(r.url)
# construct cache key
cachekey = result.path + "," + result.query
cachekey = result.path + "_" + result.query
if self.templates.get(cachekey) and not self._updated(
query_string, self.templates[cachekey], cachekey
):
Expand All @@ -1118,7 +1118,7 @@ def fields_types(self, tname, qstring, itemtype):
""" Retrieve item fields or creator types
"""
# check for a valid cached version
template_name = tname + itemtype + self.locale
template_name = tname + itemtype + "_" + self.locale
query_string = qstring.format(i=itemtype, l=self.locale)
if self.templates.get(template_name) and not self._updated(
query_string, self.templates[template_name], template_name
Expand All @@ -1132,14 +1132,14 @@ def item_type_fields(self, itemtype):
""" Get all valid fields for an item
"""
return self.fields_types(
"item_types_fields_", "/itemTypeFields?itemType={i}&locale={l}", itemtype, self.locale
"item_types_fields_", "/itemTypeFields?itemType={i}&locale={l}", itemtype
)

def item_creator_types(self, itemtype):
""" Get all available creator types for an item
"""
return self.fields_types(
"item_creator_types_", "/itemTypeCreatorTypes?itemType={i}&locale={l}", itemtype, self.locale
"item_creator_types_", "/itemTypeCreatorTypes?itemType={i}&locale={l}", itemtype
)

def item_fields(self):
Expand All @@ -1152,7 +1152,7 @@ def item_fields(self):
# now split up the URL
result = urlparse(r.url)
# construct cache key
cachekey = result.path + "," + result.query
cachekey = result.path + "_" + result.query
if self.templates.get(cachekey) and not self._updated(
query_string, self.templates[cachekey], cachekey
):
Expand Down

0 comments on commit d24ed3b

Please sign in to comment.