files
This commit is contained in:
parent
f2a7490652
commit
1db8c559a2
3 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,10 @@ class Distribution:
|
||||||
def __init__(self, architecture):
|
def __init__(self, architecture):
|
||||||
self.architecture = architecture
|
self.architecture = architecture
|
||||||
self.path = os.sep.join([DISTRIBUTION, self.architecture.name])
|
self.path = os.sep.join([DISTRIBUTION, self.architecture.name])
|
||||||
|
self.load()
|
||||||
|
|
||||||
|
def load(self):
|
||||||
|
files = self.architecture.repository.get_files(self.path)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
lines = [
|
lines = [
|
||||||
|
|
4
local.py
4
local.py
|
@ -29,6 +29,10 @@ class Local(repository.Repository):
|
||||||
d[arch] = archive
|
d[arch] = archive
|
||||||
self.archives = d
|
self.archives = d
|
||||||
|
|
||||||
|
def get_files(self, path):
|
||||||
|
*_, files = next(os.walk(os.path.join(self.location, path)))
|
||||||
|
return files
|
||||||
|
|
||||||
def get_temporary(self):
|
def get_temporary(self):
|
||||||
return os.path.join(self.temporary,
|
return os.path.join(self.temporary,
|
||||||
datetime.datetime.now()
|
datetime.datetime.now()
|
||||||
|
|
|
@ -33,6 +33,9 @@ class Remote(repository.Repository):
|
||||||
self.archives = archives
|
self.archives = archives
|
||||||
self.catalogs = c
|
self.catalogs = c
|
||||||
|
|
||||||
|
def get_files(self, path):
|
||||||
|
return hypertext.HyperText(os.path.join(self.location, path)).links
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
lines = [
|
lines = [
|
||||||
super().__str__(),
|
super().__str__(),
|
||||||
|
|
Loading…
Reference in a new issue