Commit 4026505c by Csók Tamás

client: few flake8 correction

parent 1fa0050b
...@@ -47,10 +47,10 @@ def parse_arguments(): ...@@ -47,10 +47,10 @@ def parse_arguments():
parser.add_argument("-p", "--password", type=str) parser.add_argument("-p", "--password", type=str)
parser.add_argument( parser.add_argument(
"-d", "--driver", "-d", "--driver",
help = "Select webdriver. Aside from Firefox, you have to install "+ help="Select webdriver. Aside from Firefox, you have to install "
"first the proper driver.", type=str, + "first the proper driver.", type=str,
choices = ['firefox', 'chrome', 'ie', 'opera'], choices=['firefox', 'chrome', 'ie', 'opera'],
default = "firefox") default="firefox")
args = parser.parse_args() args = parser.parse_args()
return args return args
...@@ -108,7 +108,7 @@ class Browser: ...@@ -108,7 +108,7 @@ class Browser:
vm.state, vm.protocol = "", "NONE" vm.state, vm.protocol = "", "NONE"
try: try:
while vm.state.upper()[:3] not in ("FUT", "RUN"): while vm.state.upper()[:3] not in ("FUT", "RUN"):
element = WebDriverWait(driver,7200).until( WebDriverWait(driver, 7200).until(
EC.presence_of_element_located(( EC.presence_of_element_located((
By.CSS_SELECTOR, By.CSS_SELECTOR,
"#vm-details-pw-eye.fa.fa-eye-slash"))) "#vm-details-pw-eye.fa.fa-eye-slash")))
...@@ -132,6 +132,7 @@ class Browser: ...@@ -132,6 +132,7 @@ class Browser:
raise raise
return vm return vm
def main(): def main():
""" """
Main program Main program
...@@ -141,7 +142,7 @@ def main(): ...@@ -141,7 +142,7 @@ def main():
if args.uri is not None: if args.uri is not None:
vm = Struct() vm = Struct()
vm.protocol, vm.user, vm.password, vm.host, vm.port = \ vm.protocol, vm.user, vm.password, vm.host, vm.port = \
args.uri.split(':',4) args.uri.split(':', 4)
vm.protocol = vm.protocol.upper() vm.protocol = vm.protocol.upper()
vm.state = "RUN" vm.state = "RUN"
else: else:
......
...@@ -136,7 +136,7 @@ class NXKeyGen: ...@@ -136,7 +136,7 @@ class NXKeyGen:
sRet = sRet + c2 sRet = sRet + c2
return escape(sRet) return escape(sRet)
def substr_replace(self,in_str,ch,pos,qt): def substr_replace(self, in_str, ch, pos, qt):
""" """
Replace a character at a special position Replace a character at a special position
""" """
......
...@@ -17,6 +17,7 @@ try: ...@@ -17,6 +17,7 @@ try:
except ImportError: except ImportError:
from OrderedDict import * # noqa from OrderedDict import * # noqa
def parse_arguments(): def parse_arguments():
""" """
Argument parser, based on argparse module Argument parser, based on argparse module
...@@ -27,8 +28,8 @@ def parse_arguments(): ...@@ -27,8 +28,8 @@ def parse_arguments():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument( parser.add_argument(
"-d", "--driver", "-d", "--driver",
help="Select webdriver. Aside from Firefox, you have to install "+ help="Select webdriver. Aside from Firefox, you have to install "
"first the proper driver.", type=str, default="firefox", + "first the proper driver.", type=str, default="firefox",
required=False, choices=['firefox', 'chrome', required=False, choices=['firefox', 'chrome',
'iexplore', 'opera']) 'iexplore', 'opera'])
if windowsclasses.DecideArchitecture.Is64Windows(): if windowsclasses.DecideArchitecture.Is64Windows():
......
...@@ -149,8 +149,8 @@ class RegistryHandler: ...@@ -149,8 +149,8 @@ class RegistryHandler:
temp_dict, False, architect, needed_rights) temp_dict, False, architect, needed_rights)
else: else:
if isinstance(value, list): if isinstance(value, list):
if len(value)%2 != 0: if len(value) % 2 != 0:
#print "Not enough member in the list" # print "Not enough member in the list"
raise AttributeError raise AttributeError
else: else:
new_key = CreateKeyEx( new_key = CreateKeyEx(
...@@ -173,7 +173,7 @@ class RegistryHandler: ...@@ -173,7 +173,7 @@ class RegistryHandler:
print "The provided attribute wasn't a dictionary chain" print "The provided attribute wasn't a dictionary chain"
raise AttributeError raise AttributeError
def get_key(self, key_name, needed_rights = KEY_ALL_ACCESS): def get_key(self, key_name, needed_rights=KEY_ALL_ACCESS):
""" """
Getting a registry value by it's key's name Getting a registry value by it's key's name
Can raise KeyError if key is not found in the registry Can raise KeyError if key is not found in the registry
...@@ -234,11 +234,11 @@ class RegistryHandler: ...@@ -234,11 +234,11 @@ class RegistryHandler:
combinations as keys and values combinations as keys and values
""" """
if depth == "key": if depth == "key":
int_depth = 0; int_depth = 0
elif depth == "subkeys": elif depth == "subkeys":
int_depth = 1; int_depth = 1
elif depth == "all": elif depth == "all":
int_depth = 2; int_depth = 2
else: else:
raise AttributeError raise AttributeError
try: try:
......
...@@ -47,10 +47,10 @@ def parse_arguments(): ...@@ -47,10 +47,10 @@ def parse_arguments():
parser.add_argument("-p", "--password", type=str) parser.add_argument("-p", "--password", type=str)
parser.add_argument( parser.add_argument(
"-d", "--driver", "-d", "--driver",
help = "Select webdriver. Aside from Firefox, you have to install "+ help="Select webdriver. Aside from Firefox, you have to install "
"first the proper driver.", type=str, + "first the proper driver.", type=str,
choices = ['firefox', 'chrome', 'ie', 'opera'], choices=['firefox', 'chrome', 'ie', 'opera'],
default = "firefox") default="firefox")
args = parser.parse_args() args = parser.parse_args()
return args return args
...@@ -108,7 +108,7 @@ class Browser: ...@@ -108,7 +108,7 @@ class Browser:
vm.state, vm.protocol = "", "NONE" vm.state, vm.protocol = "", "NONE"
try: try:
while vm.state.upper()[:3] not in ("FUT", "RUN"): while vm.state.upper()[:3] not in ("FUT", "RUN"):
element = WebDriverWait(driver,7200).until( WebDriverWait(driver, 7200).until(
EC.presence_of_element_located(( EC.presence_of_element_located((
By.CSS_SELECTOR, By.CSS_SELECTOR,
"#vm-details-pw-eye.fa.fa-eye-slash"))) "#vm-details-pw-eye.fa.fa-eye-slash")))
...@@ -132,6 +132,7 @@ class Browser: ...@@ -132,6 +132,7 @@ class Browser:
raise raise
return vm return vm
def main(): def main():
""" """
Main program Main program
...@@ -141,7 +142,7 @@ def main(): ...@@ -141,7 +142,7 @@ def main():
if args.uri is not None: if args.uri is not None:
vm = Struct() vm = Struct()
vm.protocol, vm.user, vm.password, vm.host, vm.port = \ vm.protocol, vm.user, vm.password, vm.host, vm.port = \
args.uri.split(':',4) args.uri.split(':', 4)
vm.protocol = vm.protocol.upper() vm.protocol = vm.protocol.upper()
vm.state = "RUN" vm.state = "RUN"
else: else:
......
...@@ -136,7 +136,7 @@ class NXKeyGen: ...@@ -136,7 +136,7 @@ class NXKeyGen:
sRet = sRet + c2 sRet = sRet + c2
return escape(sRet) return escape(sRet)
def substr_replace(self,in_str,ch,pos,qt): def substr_replace(self, in_str, ch, pos, qt):
""" """
Replace a character at a special position Replace a character at a special position
""" """
......
...@@ -17,6 +17,7 @@ try: ...@@ -17,6 +17,7 @@ try:
except ImportError: except ImportError:
from OrderedDict import * # noqa from OrderedDict import * # noqa
def parse_arguments(): def parse_arguments():
""" """
Argument parser, based on argparse module Argument parser, based on argparse module
...@@ -27,8 +28,8 @@ def parse_arguments(): ...@@ -27,8 +28,8 @@ def parse_arguments():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument( parser.add_argument(
"-d", "--driver", "-d", "--driver",
help="Select webdriver. Aside from Firefox, you have to install "+ help="Select webdriver. Aside from Firefox, you have to install "
"first the proper driver.", type=str, default="firefox", + "first the proper driver.", type=str, default="firefox",
required=False, choices=['firefox', 'chrome', required=False, choices=['firefox', 'chrome',
'iexplore', 'opera']) 'iexplore', 'opera'])
if windowsclasses.DecideArchitecture.Is64Windows(): if windowsclasses.DecideArchitecture.Is64Windows():
......
...@@ -149,8 +149,8 @@ class RegistryHandler: ...@@ -149,8 +149,8 @@ class RegistryHandler:
temp_dict, False, architect, needed_rights) temp_dict, False, architect, needed_rights)
else: else:
if isinstance(value, list): if isinstance(value, list):
if len(value)%2 != 0: if len(value) % 2 != 0:
#print "Not enough member in the list" # print "Not enough member in the list"
raise AttributeError raise AttributeError
else: else:
new_key = CreateKeyEx( new_key = CreateKeyEx(
...@@ -173,7 +173,7 @@ class RegistryHandler: ...@@ -173,7 +173,7 @@ class RegistryHandler:
print "The provided attribute wasn't a dictionary chain" print "The provided attribute wasn't a dictionary chain"
raise AttributeError raise AttributeError
def get_key(self, key_name, needed_rights = KEY_ALL_ACCESS): def get_key(self, key_name, needed_rights=KEY_ALL_ACCESS):
""" """
Getting a registry value by it's key's name Getting a registry value by it's key's name
Can raise KeyError if key is not found in the registry Can raise KeyError if key is not found in the registry
...@@ -234,11 +234,11 @@ class RegistryHandler: ...@@ -234,11 +234,11 @@ class RegistryHandler:
combinations as keys and values combinations as keys and values
""" """
if depth == "key": if depth == "key":
int_depth = 0; int_depth = 0
elif depth == "subkeys": elif depth == "subkeys":
int_depth = 1; int_depth = 1
elif depth == "all": elif depth == "all":
int_depth = 2; int_depth = 2
else: else:
raise AttributeError raise AttributeError
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment