-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced WebFile class with Downloadable class + helper functions for…
… downloading files
- Loading branch information
Showing
3 changed files
with
81 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
import re | ||
from os import path | ||
from .web import Downloadable | ||
|
||
from .web import WebFile | ||
|
||
class Cape: | ||
|
||
def __init__(self, filename: str): | ||
self.__filename = filename | ||
self.__file = WebFile(self.__filename) | ||
|
||
@property | ||
def file(self): | ||
return self.__file | ||
|
||
@property | ||
def data(self): | ||
return self.__file.data() | ||
|
||
def save(self, dest: str): | ||
return self.__file.save(dest) | ||
class Cape(Downloadable): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
import re | ||
from os import path | ||
from .web import Downloadable | ||
|
||
from .web import WebFile | ||
|
||
class Skin: | ||
class Skin(Downloadable): | ||
|
||
def __init__(self, filename: str, variant='classic'): | ||
self.__filename = filename | ||
def __init__(self, source: str, variant: str='classic'): | ||
super().__init__(source) | ||
self.__variant = variant | ||
self.__file = WebFile(self.__filename) | ||
|
||
@property | ||
def variant(self): | ||
return self.__variant | ||
|
||
@property | ||
def file(self): | ||
return self.__file | ||
|
||
@property | ||
def data(self): | ||
return self.__file.data() | ||
|
||
def save(self, dest: str): | ||
return self.__file.save(dest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters