|
121 |
return new_cls |
121 |
return new_cls |
122 |
|
122 |
|
123 |
|
123 |
|
124 |
class UniventionAppAction(object): |
124 |
class UniventionAppAction(object, metaclass=UniventionAppActionMeta): |
125 |
__metaclass__ = UniventionAppActionMeta |
|
|
126 |
|
127 |
parent_logger = get_base_logger().getChild('actions') |
125 |
parent_logger = get_base_logger().getChild('actions') |
128 |
|
126 |
|
129 |
def __init__(self): |
127 |
def __init__(self): |
|
186 |
default = getattr(_namespace, action.dest) |
184 |
default = getattr(_namespace, action.dest) |
187 |
args[action.dest] = default |
185 |
args[action.dest] = default |
188 |
args.update(kwargs) |
186 |
args.update(kwargs) |
189 |
for key, value in args.iteritems(): |
187 |
for key, value in args.items(): |
190 |
setattr(namespace, key, value) |
188 |
setattr(namespace, key, value) |
191 |
return namespace |
189 |
return namespace |
192 |
|
190 |
|
|
266 |
return args.username |
264 |
return args.username |
267 |
if not args.noninteractive: |
265 |
if not args.noninteractive: |
268 |
try: |
266 |
try: |
269 |
username = raw_input('Username: ') |
267 |
username = input('Username: ') |
270 |
if not username: |
268 |
if not username: |
271 |
raise EOFError() |
269 |
raise EOFError() |
272 |
except (EOFError, KeyboardInterrupt): |
270 |
except (EOFError, KeyboardInterrupt): |
|
356 |
server = 'https://%s' % server |
354 |
server = 'https://%s' % server |
357 |
uri = '%s/univention/%s' % (server, path) |
355 |
uri = '%s/univention/%s' % (server, path) |
358 |
args = [] |
356 |
args = [] |
359 |
for key, value in kwargs.iteritems(): |
357 |
for key, value in kwargs.items(): |
360 |
if value is None: |
358 |
if value is None: |
361 |
continue |
359 |
continue |
362 |
if not isinstance(value, (tuple, list)): |
360 |
if not isinstance(value, (tuple, list)): |