mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
73bd65b8a9
commit
2b90a745b6
|
@ -35,7 +35,7 @@ from utils import removeDomainPort
|
|||
from utils import isAccountDir
|
||||
from utils import acct_dir
|
||||
from utils import isfloat
|
||||
from utils import getCategoryTypes
|
||||
from utils import get_category_types
|
||||
from utils import getSharesFilesList
|
||||
from utils import local_actor_url
|
||||
from media import processMetaData
|
||||
|
@ -187,7 +187,7 @@ def _dfcProductTypeFromCategory(base_dir: str,
|
|||
This will be used to select an appropriate ontology file
|
||||
such as ontology/foodTypes.json
|
||||
"""
|
||||
productTypesList = getCategoryTypes(base_dir)
|
||||
productTypesList = get_category_types(base_dir)
|
||||
categoryLower = itemCategory.lower()
|
||||
for productType in productTypesList:
|
||||
if translate.get(productType):
|
||||
|
@ -1762,7 +1762,7 @@ def _dfcToSharesFormat(catalogJson: {},
|
|||
sharesJson = {}
|
||||
|
||||
dfcIds = {}
|
||||
productTypesList = getCategoryTypes(base_dir)
|
||||
productTypesList = get_category_types(base_dir)
|
||||
for productType in productTypesList:
|
||||
dfcIds[productType] = \
|
||||
_loadDfcIds(base_dir, system_language, productType,
|
||||
|
|
4
tests.py
4
tests.py
|
@ -59,7 +59,7 @@ from utils import dangerousSVG
|
|||
from utils import canReplyTo
|
||||
from utils import isGroupAccount
|
||||
from utils import get_actor_languages_list
|
||||
from utils import getCategoryTypes
|
||||
from utils import get_category_types
|
||||
from utils import getSupportedLanguages
|
||||
from utils import setConfigParam
|
||||
from utils import isGroupActor
|
||||
|
@ -5703,7 +5703,7 @@ def _testGetPriceFromString() -> None:
|
|||
|
||||
def _translateOntology(base_dir: str) -> None:
|
||||
return
|
||||
ontologyTypes = getCategoryTypes(base_dir)
|
||||
ontologyTypes = get_category_types(base_dir)
|
||||
url = 'https://translate.astian.org'
|
||||
apiKey = None
|
||||
ltLangList = libretranslateLanguages(url, apiKey)
|
||||
|
|
12
utils.py
12
utils.py
|
@ -3122,12 +3122,12 @@ def getSupportedLanguages(base_dir: str) -> []:
|
|||
return languagesStr
|
||||
|
||||
|
||||
def getCategoryTypes(base_dir: str) -> []:
|
||||
def get_category_types(base_dir: str) -> []:
|
||||
"""Returns the list of ontologies
|
||||
"""
|
||||
ontologyDir = base_dir + '/ontology'
|
||||
ontology_dir = base_dir + '/ontology'
|
||||
categories = []
|
||||
for _, _, files in os.walk(ontologyDir):
|
||||
for _, _, files in os.walk(ontology_dir):
|
||||
for f in files:
|
||||
if not f.endswith('.json'):
|
||||
continue
|
||||
|
@ -3135,9 +3135,9 @@ def getCategoryTypes(base_dir: str) -> []:
|
|||
continue
|
||||
if f.startswith('custom'):
|
||||
continue
|
||||
ontologyFilename = f.split('.')[0]
|
||||
if 'Types' in ontologyFilename:
|
||||
categories.append(ontologyFilename.replace('Types', ''))
|
||||
ontology_filename = f.split('.')[0]
|
||||
if 'Types' in ontology_filename:
|
||||
categories.append(ontology_filename.replace('Types', ''))
|
||||
break
|
||||
return categories
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ from utils import getMediaFormats
|
|||
from utils import get_config_param
|
||||
from utils import acct_dir
|
||||
from utils import getCurrencies
|
||||
from utils import getCategoryTypes
|
||||
from utils import get_category_types
|
||||
from webapp_utils import getBannerFile
|
||||
from webapp_utils import htmlHeaderWithExternalStyle
|
||||
from webapp_utils import htmlFooter
|
||||
|
@ -452,7 +452,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
|
|||
extraFields += '<br>' + \
|
||||
editTextField(translate['Type of shared item. eg. hat'] + ':',
|
||||
'itemType', '', '', True)
|
||||
categoryTypes = getCategoryTypes(base_dir)
|
||||
categoryTypes = get_category_types(base_dir)
|
||||
catStr = translate['Category of shared item. eg. clothing']
|
||||
extraFields += '<label class="labels">' + catStr + '</label><br>\n'
|
||||
|
||||
|
@ -517,7 +517,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
|
|||
extraFields += '<br>' + \
|
||||
editTextField(translate['Type of wanted item. eg. hat'] + ':',
|
||||
'itemType', '', '', True)
|
||||
categoryTypes = getCategoryTypes(base_dir)
|
||||
categoryTypes = get_category_types(base_dir)
|
||||
catStr = translate['Category of wanted item. eg. clothes']
|
||||
extraFields += '<label class="labels">' + catStr + '</label><br>\n'
|
||||
|
||||
|
|
Loading…
Reference in New Issue