__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import os
from pathlib import Path
from typing import Union
class FileIO:
def __init__(self, path: Union[os.PathLike, str]):
if isinstance(path, str):
path = Path(path)
self.path = path
def read(self): # Returns bytes/str
# We would like to read unicode here, but we cannot, because we are not
# sure if it is a valid unicode file. Therefore just read whatever is
# here.
with open(self.path, 'rb') as f:
return f.read()
def get_last_modified(self):
"""
Returns float - timestamp or None, if path doesn't exist.
"""
try:
return os.path.getmtime(self.path)
except FileNotFoundError:
return None
def __repr__(self):
return '%s(%s)' % (self.__class__.__name__, self.path)
class KnownContentFileIO(FileIO):
def __init__(self, path, content):
super().__init__(path)
self._content = content
def read(self):
return self._content
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| pgen2 | Folder | 0755 |
|
|
| python | Folder | 0755 |
|
|
| __init__.py | File | 1.57 KB | 0644 |
|
| _compatibility.py | File | 70 B | 0644 |
|
| cache.py | File | 8.25 KB | 0644 |
|
| file_io.py | File | 1023 B | 0644 |
|
| grammar.py | File | 10.31 KB | 0644 |
|
| normalizer.py | File | 5.47 KB | 0644 |
|
| parser.py | File | 7.01 KB | 0644 |
|
| tree.py | File | 15.77 KB | 0644 |
|
| utils.py | File | 6.46 KB | 0644 |
|