over.core.app configured, beginning main loop
This commit is contained in:
parent
a5c1b81a3a
commit
3243f46772
2 changed files with 79 additions and 6 deletions
31
aux.py
Normal file
31
aux.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
#! /bin/env python3
|
||||
# encoding: utf-8
|
||||
|
||||
class Command:
|
||||
def __init__(self, sequence):
|
||||
self.__dict__["sequence"] = list(sequence)
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
found = False
|
||||
|
||||
for i, word in enumerate(self.sequence):
|
||||
if word == name:
|
||||
self.sequence[i] = value
|
||||
found = True
|
||||
|
||||
if not found:
|
||||
raise AttributeError("Command has no attribute \'%s\'" %(name))
|
||||
|
||||
def dump(self, sequence=None):
|
||||
out = []
|
||||
|
||||
if not sequence:
|
||||
sequence = self.sequence
|
||||
|
||||
for item in sequence:
|
||||
if type(item) is list:
|
||||
out += self.dump(item)
|
||||
else:
|
||||
out.append(str(item))
|
||||
|
||||
return out
|
Loading…
Add table
Add a link
Reference in a new issue