MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / get_abs_path

Method get_abs_path

web/pgadmin/misc/file_manager/__init__.py:947–974  ·  view source on GitHub ↗
(in_dir, path)

Source from the content-addressed store, hash-verified

945
946 @staticmethod
947 def get_abs_path(in_dir, path):
948
949 if (path.startswith('\\\\') and _platform == 'win32')\
950 or config.SERVER_MODE is False or in_dir is None:
951 return "{}".format(path)
952
953 if path == '/' or path == '\\':
954 if _platform == 'win32':
955 if in_dir.endswith('\\') or in_dir.endswith('/'):
956 return "{}".format(in_dir)
957 else:
958 return "{}{}".format(in_dir, '\\')
959 else:
960 if in_dir.endswith('/'):
961 return "{}".format(in_dir)
962 else:
963 return "{}{}".format(in_dir, '/')
964
965 if in_dir.endswith('/') or in_dir.endswith('\\'):
966 if path.startswith('/') or path.startswith('\\'):
967 return "{}{}".format(in_dir[:-1], path)
968 else:
969 return TWO_PARAM_STRING.format(in_dir, path)
970 else:
971 if path.startswith('/') or path.startswith('\\'):
972 return "{}{}".format(in_dir, path)
973 else:
974 return TWO_PARAM_STRING.format(in_dir, path)
975
976 def validate_request(self, capability):
977 """

Callers 2

list_filesystemMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected