* comar'in gerekmedigi yerlerde default olarak True yap ignore_comar
secenegini. Diger implementation'lara karismiyoruz.
This commit is contained in:
@@ -57,6 +57,7 @@ class Command(object):
|
|||||||
self.options()
|
self.options()
|
||||||
self.commonopts()
|
self.commonopts()
|
||||||
(self.options, self.args) = self.parser.parse_args()
|
(self.options, self.args) = self.parser.parse_args()
|
||||||
|
self.override_options()
|
||||||
self.args.pop(0) # exclude command arg
|
self.args.pop(0) # exclude command arg
|
||||||
|
|
||||||
self.check_auth_info()
|
self.check_auth_info()
|
||||||
@@ -86,6 +87,12 @@ class Command(object):
|
|||||||
options function it will be called"""
|
options function it will be called"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def override_options(self):
|
||||||
|
# if ignore_comar is not defined, it is True, where it is defined
|
||||||
|
# its default is False. Confused? Don't get confused, it's correct :)
|
||||||
|
if not hasattr(self.options, 'ignore_comar'):
|
||||||
|
self.options.ignore_comar = True
|
||||||
|
|
||||||
def check_auth_info(self):
|
def check_auth_info(self):
|
||||||
username = self.options.username
|
username = self.options.username
|
||||||
password = self.options.password
|
password = self.options.password
|
||||||
|
|||||||
Reference in New Issue
Block a user