Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Sourcery refactored master branch #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Dec 17, 2022

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from coordt December 17, 2022 17:51
@@ -2,6 +2,7 @@
These are the default configuration options for Django-elRTE
"""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 25-51 refactored with the following changes:

'cssfiles': ['%selrte-inner.css' % elrte.settings.CSS_BASE_URL],
'cssfiles': [f'{elrte.settings.CSS_BASE_URL}elrte-inner.css'],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 19-30 refactored with the following changes:

This removes the following comments ( why? ):

# 'fmOpen': FileManagerOpener(),

Comment on lines -71 to +72
html = [u'<textarea%s>%s</textarea>' % (flatatt(final_attrs), escape(value))]
html = [f'<textarea{flatatt(final_attrs)}>{escape(value)}</textarea>']
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ElrteTextareaWidget.render refactored with the following changes:

Comment on lines -94 to +104
if content_language:
content_language = content_language[:2]
else:
content_language = language

config = {}
config['language'] = language

content_language = content_language[:2] if content_language else language
config = {'language': language}
lang_names = SortedDict()
for lang, name in settings.LANGUAGES:
if lang[:2] not in lang_names: lang_names[lang[:2]] = []
lang_names[lang[:2]].append(_(name))
sp_langs = []
for lang, names in lang_names.items():
if lang == content_language:
default = '+'
else:
default = ''
sp_langs.append(u'%s%s=%s' % (default, ' / '.join(names), lang))
default = '+' if lang == content_language else ''
sp_langs.append(f"{default}{' / '.join(names)}={lang}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_language_config refactored with the following changes:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants