MCPcopy Create free account
hub / github.com/IQEngine/IQEngine / get_file_name

Function get_file_name

api/helpers/urlmapping.py:45–74  ·  view source on GitHub ↗

Get the file name for the apiType Parameters ---------- filepath : str The file path apiType : ApiType The type of the api Returns ------- str The file name with extension

(filepath: str, apiType: ApiType)

Source from the content-addressed store, hash-verified

43
44
45def get_file_name(filepath: str, apiType: ApiType) -> str:
46 """
47 Get the file name for the apiType
48
49 Parameters
50 ----------
51 filepath : str
52 The file path
53 apiType : ApiType
54 The type of the api
55
56 Returns
57 -------
58 str
59 The file name with extension
60 """
61
62 match apiType:
63 case ApiType.THUMB:
64 return filepath + ".jpg"
65 case ApiType.IMAGE:
66 return "datasource_thumbnail.jpg"
67 case ApiType.IQDATA:
68 return filepath + ".sigmf-data"
69 case ApiType.METADATA:
70 return filepath + ".sigmf-meta"
71 case ApiType.MINIMAP:
72 return filepath + ".minimap"
73 case _:
74 raise ValueError("Invalid ApiType value")
75
76
77def add_URL_sasToken(account, container, sasToken, filepath, apiType: ApiType):

Callers 5

get_new_thumbnailMethod · 0.90
get_iq_dataFunction · 0.90
get_iqfileFunction · 0.90
get_minimap_iqFunction · 0.90
get_meta_thumbnailFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected