Add files via upload
This commit is contained in:
parent
61460b2f74
commit
27c3bea52e
5 changed files with 24 additions and 12 deletions
|
@ -1,10 +1,13 @@
|
|||
import re
|
||||
import lxml.html
|
||||
from typing import Any, Dict, List
|
||||
from typing import Any, Dict, List, Optional
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from . import atserver
|
||||
from . import atconnect
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from atserver import AternosServer
|
||||
|
||||
OPT_PLAYERS = 'max-players'
|
||||
OPT_GAMEMODE = 'gamemode'
|
||||
OPT_DIFFICULTY = 'difficulty'
|
||||
|
@ -72,7 +75,7 @@ FLAG_PROP_TYPE = 1
|
|||
|
||||
class AternosConfig:
|
||||
|
||||
def __init__(self, atserv:atserver.AternosServer) -> None:
|
||||
def __init__(self, atserv:'AternosServer') -> None:
|
||||
|
||||
self.atserv = atserv
|
||||
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
import lxml.html
|
||||
from typing import Union
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from . import atserver
|
||||
from . import atconnect
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from atserver import AternosServer
|
||||
|
||||
FTYPE_FILE = 0
|
||||
FTYPE_DIR = 1
|
||||
|
||||
class AternosFile:
|
||||
|
||||
def __init__(
|
||||
atserv:atserver.AternosServer,
|
||||
self, atserv:'AternosServer',
|
||||
path:str, name:str, ftype:int=FTYPE_FILE,
|
||||
size:Union[int,float]=0, dlallowed:bool=False) -> None:
|
||||
|
||||
|
@ -96,5 +99,5 @@ class AternosFile:
|
|||
return self._size
|
||||
|
||||
@property
|
||||
def dlallowed(self):
|
||||
def dlallowed(self) -> bool:
|
||||
return self._dlallowed
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
import lxml.html
|
||||
from typing import Optional, Union, List
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from . import atserver
|
||||
from . import atconnect
|
||||
from . import atfile
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from atserver import AternosServer
|
||||
|
||||
class AternosFileManager:
|
||||
|
||||
def __init__(atserv:atserver.AternosServer) -> None:
|
||||
def __init__(self, atserv:'AternosServer') -> None:
|
||||
|
||||
self.atserv = atserv
|
||||
|
||||
|
@ -49,7 +52,7 @@ class AternosFileManager:
|
|||
if len(dlbutton) > 0:
|
||||
dlallowed = True
|
||||
|
||||
fullpath = f.xpath('/@data-path')[0]
|
||||
fullpath = f.xpath('/@data-path')
|
||||
filepath = fullpath[:fullpath.rfind('/')]
|
||||
filename = fullpath[fullpath.rfind('/'):]
|
||||
files.append(
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
import lxml.html
|
||||
from typing import List
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from . import atserver
|
||||
from . import atconnect
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from atserver import AternosServer
|
||||
|
||||
class AternosPlayersList:
|
||||
|
||||
def __init__(self, lst:str, atserv:atserver.AternosServer) -> None:
|
||||
def __init__(self, lst:str, atserv:'AternosServer') -> None:
|
||||
|
||||
self.atserv = atserv
|
||||
self.lst = lst
|
||||
|
|
|
@ -40,7 +40,7 @@ class AternosServer:
|
|||
self._info = json.loads(
|
||||
re.search(
|
||||
r'var\s*lastStatus\s*=\s*({.*})',
|
||||
servtree.head.text
|
||||
servtree.head.text_content()
|
||||
)[1]
|
||||
)
|
||||
|
||||
|
|
Reference in a new issue