MCPcopy Create free account
hub / github.com/c-jimenez/open-ocpp / check_dir_exists

Function check_dir_exists

tools/json2cpp/json2cpp.py:228–250  ·  view source on GitHub ↗

Check if a directory exists @param dir: Name of the directory to check @type dir: string @param path: Path to the directory to check @type path: string @return: if the directory exists : True, if not : False @rtype: boolean

(dir, path)

Source from the content-addressed store, hash-verified

226 ''' Dictionnary of the request and response types '''
227
228def check_dir_exists(dir, path) -> bool:
229 '''
230 Check if a directory exists
231
232 @param dir: Name of the directory to check
233 @type dir: string
234
235 @param path: Path to the directory to check
236 @type path: string
237
238 @return: if the directory exists : True, if not : False
239 @rtype: boolean
240 '''
241
242 ret = False
243 if os.path.exists(path):
244 if os.path.exists(path):
245 ret = True
246 else:
247 print(f"{dir} must be a directory")
248 else:
249 print(f"{dir} does not exists")
250 return ret
251
252def check_args(args, params):
253 '''

Callers 1

check_argsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected