Skip to content

Commit

Permalink
2️⃣3️⃣ attempt to preserve version compatibility
Browse files Browse the repository at this point in the history
🚿 pylint edit

🚿 flake8 edit

🚿 flake8 edit

🐛 fixed TypeError
  • Loading branch information
Ryan Patrick Kyle committed Jan 22, 2019
1 parent 8aa3f25 commit 5e251f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dash/development/_r_components_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def generate_class_string(name, props, project_shortname, prefix):
# Filter props to remove those we don't want to expose
for item in prop_keys[:]:
if item.endswith('-*') \
or item in r_keywords + ['setProps']:
or item in r_keywords \
or item == 'setProps':
prop_keys.remove(item)

default_argtext += ", ".join(
Expand Down
6 changes: 5 additions & 1 deletion dash/development/component_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,17 @@ def cli():
rprefix=args.r_prefix)


# pylint: disable=undefined-variable
def byteify(input_object):
if isinstance(input_object, dict):
return {byteify(key): byteify(value)
for key, value in input_object.iteritems()}
elif isinstance(input_object, list):
return [byteify(element) for element in input_object]
elif isinstance(input_object, unicode):
elif sys.version_info[0] >= 3:
if isinstance(input_object, str):
return input_object.encode('utf-8')
elif isinstance(input_object, unicode): # noqa:F821
return input_object.encode('utf-8')
return input_object

Expand Down

0 comments on commit 5e251f0

Please sign in to comment.