arguments
This commit is contained in:
parent
1857f0e1b0
commit
80e76995a5
5 changed files with 21 additions and 18 deletions
16
__init__.py
16
__init__.py
|
@ -7,7 +7,7 @@ import local
|
|||
import synchronization
|
||||
|
||||
|
||||
def build(args):
|
||||
def build():
|
||||
# TODO identify
|
||||
print('TODO identify')
|
||||
# TODO extract
|
||||
|
@ -18,7 +18,7 @@ def build(args):
|
|||
print('TODO archive')
|
||||
|
||||
|
||||
def check(args):
|
||||
def check():
|
||||
# TODO prepare threads
|
||||
print('TODO prepare threads')
|
||||
# TODO run threads
|
||||
|
@ -27,20 +27,18 @@ def check(args):
|
|||
print('TODO watch threads')
|
||||
|
||||
|
||||
def info(args):
|
||||
print(local.Local(args))
|
||||
def info():
|
||||
print(local.Local())
|
||||
|
||||
|
||||
def sync(args):
|
||||
sync = synchronization.Synchronization(args)
|
||||
def sync():
|
||||
sync = synchronization.Synchronization()
|
||||
print(sync)
|
||||
sync.run()
|
||||
|
||||
|
||||
def main():
|
||||
args = arguments.parse()
|
||||
function = getattr(sys.modules[__name__], args[arguments.ACTION])
|
||||
function(args)
|
||||
getattr(sys.modules[__name__], arguments.action)()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -85,5 +85,10 @@ compression applying to archive
|
|||
|
||||
D = parse()
|
||||
|
||||
action = D[ACTION]
|
||||
architectures = D[ARCHITECTURES]
|
||||
directory = D[DIRECTORY]
|
||||
remote = D[REMOTE]
|
||||
subsystems = D[SUBSYSTEMS]
|
||||
temporary = D[TEMPORARY]
|
||||
threads = D[THREADS]
|
||||
|
|
6
local.py
6
local.py
|
@ -8,9 +8,9 @@ import repository
|
|||
|
||||
|
||||
class Local(repository.Repository):
|
||||
def __init__(self, args):
|
||||
super().__init__(args[arguments.DIRECTORY])
|
||||
self.temporary = args[arguments.TEMPORARY]
|
||||
def __init__(self):
|
||||
super().__init__(arguments.directory)
|
||||
self.temporary = arguments.temporary
|
||||
self.load()
|
||||
|
||||
def load(self):
|
||||
|
|
|
@ -9,8 +9,8 @@ import repository
|
|||
|
||||
|
||||
class Remote(repository.Repository):
|
||||
def __init__(self, args):
|
||||
super().__init__(args[arguments.REMOTE])
|
||||
def __init__(self):
|
||||
super().__init__(arguments.remote)
|
||||
self.load()
|
||||
|
||||
def load(self):
|
||||
|
|
|
@ -8,11 +8,11 @@ import remote
|
|||
|
||||
|
||||
class Synchronization:
|
||||
def __init__(self, args):
|
||||
self.remote = remote.Remote(args)
|
||||
self.repository = local.Local(args)
|
||||
def __init__(self):
|
||||
self.remote = remote.Remote()
|
||||
self.repository = local.Local()
|
||||
self.temporary = self.repository.get_temporary()
|
||||
self.threads = args[arguments.THREADS]
|
||||
self.threads = arguments.threads
|
||||
|
||||
def run(self):
|
||||
for architecture in self.remote.architectures:
|
||||
|
|
Loading…
Reference in a new issue