Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incomplete and redundant constants #321

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/formpack/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
'hxl': '',
}

GEO_QUESTION_TYPES = ('geopoint', 'geotrace', 'geoshape')
MEDIA_TYPES = ('audio', 'image', 'video')

# Export Settings
EXPORT_SETTING_FIELDS = 'fields'
EXPORT_SETTING_FIELDS_FROM_ALL_VERSIONS = 'fields_from_all_versions'
Expand Down
5 changes: 2 additions & 3 deletions src/formpack/reporting/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import xlsxwriter

from ..constants import (
GEO_QUESTION_TYPES,
TAG_COLUMNS_AND_SEPARATORS,
UNSPECIFIED_TRANSLATION,
)
Expand All @@ -24,7 +23,7 @@
from ..utils.flatten_content import flatten_tag_list
from ..utils.geojson import field_and_response_to_geometry
from ..utils.iterator import get_first_occurrence
from ..utils.replace_aliases import EXTENDED_MEDIA_TYPES
from ..utils.replace_aliases import EXTENDED_MEDIA_TYPES, GEO_TYPES
from ..utils.spss import spss_labels_from_variables_dict
from ..utils.string import unique_name_for_xls
from ..utils.text import get_valid_filename
Expand Down Expand Up @@ -697,7 +696,7 @@ def to_geojson(

all_fields = version.sections[first_section_name].fields.values()
all_geo_fields = [
f for f in all_fields if f.data_type in GEO_QUESTION_TYPES
f for f in all_fields if f.data_type in GEO_TYPES
]
all_geo_field_names = [f.name for f in all_geo_fields]

Expand Down
3 changes: 1 addition & 2 deletions src/formpack/utils/expand_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@

from .array_to_xpath import EXPANDABLE_FIELD_TYPES
from .iterator import get_first_occurrence
from .replace_aliases import META_TYPES, selects
from .replace_aliases import MEDIA_TYPES, META_TYPES, selects
from ..constants import (
MEDIA_TYPES,
OR_OTHER_COLUMN,
TAG_COLUMNS_AND_SEPARATORS,
UNTRANSLATED,
Expand Down
Loading