py_everything.path
¶
Source code: py_everything/path.py
This module deals with paths, local or web.
New in version 2.1.0.
- class py_everything.path.Path(path)¶
This class contains all functions related to Path.
The REGEX’s used to check the path can also be used, you need to import them.
- Parameters
path (str) – String containing full path(web or local)
- Raises
error.UnknownPathTypeError – Raised if path type can’t be determined.
- getType()¶
Returns type of file as ``str``(‘local’ or ‘web’)
- Returns str
Type of file(‘local’ or ‘web’)
- getRawPath()¶
Returns raw input path as-is without any modifications.
- Returns str
Raw Input Path as-is
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is web
- getRealPath()¶
Returns real path based on system type and os.
- Returns str
Real Path based on system type and operating system
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is web
- isFile()¶
Returns boolean depending on if the path is to a file or a folder.
- Returns bool
True if the path is to a file
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is web
- isDir()¶
Returns boolean depending on if the path is to a file or a folder.
- Returns bool
True if the path is to a folder/directory
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is web
- getRelativePath()¶
Returns path relative to
os.curdir
- Returns str
Path relative to
os.curdir
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is web
- getLastAccessTime()¶
Returns last accessed time for file/folder.
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is web
- getLastModifiedTime()¶
Returns last modified time for file/folder.
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is web
- openInBrowser()¶
Opens URL in default browser.
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is local
- getRequest()¶
Returns Requests Response Object.
- Returns
Response object of get request to URL
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is local
- getRequestStatusCode()¶
Returns status code for get request to URL.
- Returns int
Status code
- Raises
error.InvalidOperationPerformedError – This is raised if the path type is local