Skip to content

Commit

Permalink
Merge pull request #321 from kobotoolbox/bad-constants
Browse files Browse the repository at this point in the history
Remove incomplete and redundant constants
  • Loading branch information
jnm authored Apr 30, 2024
2 parents d53b10c + 443a8e9 commit 95e2743
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
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

0 comments on commit 95e2743

Please sign in to comment.