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)
| 226 | ''' Dictionnary of the request and response types ''' |
| 227 | |
| 228 | def 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 | |
| 252 | def check_args(args, params): |
| 253 | ''' |