Skip to content

Commit

Permalink
quick lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cguardia committed Sep 21, 2020
1 parent 213c488 commit 11b4218
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions questions/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from .settings import SURVEY_JS_CDN
from .settings import SURVEY_JS_PLATFORMS
from .settings import SURVEY_JS_THEMES
from .templates import SURVEY_JS
from .templates import SURVEY_HTML
from .templates import get_form_page
from .templates import get_platform_js_resources
from .templates import get_survey_js
Expand Down
3 changes: 1 addition & 2 deletions questions/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,14 @@
"max_time_to_finish": ...,
"max_time_to_finish_page": ...,
"mode": ...,
"question_title_location": ...,
"questions_order": ...,
"navigate_to_url": ...,
"navigate_to_url_on_condition": ...,
"page_next_text": ...,
"page_prev_text": ...,
"preview_text": ...,
"progress_bar_type": ...,
"questions_on_page_mode": ...,
"questions_order": ...,
"question_description_location": ...,
"question_error_location": ...,
"question_start_index": ...,
Expand Down
5 changes: 4 additions & 1 deletion questions/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{}
"""

PLATFORM_JS= {
PLATFORM_JS = {
"jquery": """var survey = new Survey.Model(json);
survey.data = data;
$("#questions_form").Survey({
Expand Down Expand Up @@ -185,6 +185,7 @@ def get_platform_js_resources(platform, resource_url):
platform_js.append(survey_js)
return platform_js


def get_theme_css_resources(theme, resource_url):
if theme == "bootstrap" and resource_url == SURVEY_JS_CDN:
return [BOOTSTRAP_URL]
Expand All @@ -195,13 +196,15 @@ def get_theme_css_resources(theme, resource_url):
name = "modern"
return [f"{resource_url}/{name}.css"]


def get_survey_js(form_json, form_data, action, theme, platform):
if form_data is None:
form_data = {}
platform_js = PLATFORM_JS[platform]
data = json.dumps(form_data)
return SURVEY_JS.format(theme, form_json, data, action, platform_js)


def get_form_page(title, platform, js, js_resources, css_resources):
resources = ""
platform_html = SURVEY_HTML[platform]
Expand Down
2 changes: 0 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

"""Tests for `cli` package."""

import pytest

from click.testing import CliRunner

from questions import cli
Expand Down

0 comments on commit 11b4218

Please sign in to comment.