1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-17 22:45:08 +00:00

Moved File to objects

This commit is contained in:
sudosnok 2022-04-12 18:41:56 +01:00
parent 6483909960
commit a181273189
2 changed files with 16 additions and 16 deletions

View file

@ -7,28 +7,13 @@ __all__ = (
import asyncio
import functools
import io
import aiohttp
from . import exceptions
from .cache import RepoCache, UserCache
from .http import http
from .objects import Gist, Issue, Organization, Repository, User
class File:
def __init__(self, fp: str | io.StringIO, filename: str = 'DefaultFilename.txt'):
self.fp = fp
self.filename = filename
def read(self) -> str:
if isinstance(self.fp, str):
with open(self.fp) as fp:
data = fp.read()
return data
else:
return self.fp.read()
from .objects import Gist, Issue, Organization, Repository, User, File
class GHClient: