Commit 4026505c by Csók Tamás

client: few flake8 correction

parent 1fa0050b
......@@ -47,10 +47,10 @@ def parse_arguments():
parser.add_argument("-p", "--password", type=str)
parser.add_argument(
"-d", "--driver",
help = "Select webdriver. Aside from Firefox, you have to install "+
"first the proper driver.", type=str,
choices = ['firefox', 'chrome', 'ie', 'opera'],
default = "firefox")
help="Select webdriver. Aside from Firefox, you have to install "
+ "first the proper driver.", type=str,
choices=['firefox', 'chrome', 'ie', 'opera'],
default="firefox")
args = parser.parse_args()
return args
......@@ -108,7 +108,7 @@ class Browser:
vm.state, vm.protocol = "", "NONE"
try:
while vm.state.upper()[:3] not in ("FUT", "RUN"):
element = WebDriverWait(driver,7200).until(
WebDriverWait(driver, 7200).until(
EC.presence_of_element_located((
By.CSS_SELECTOR,
"#vm-details-pw-eye.fa.fa-eye-slash")))
......@@ -132,6 +132,7 @@ class Browser:
raise
return vm
def main():
"""
Main program
......@@ -141,7 +142,7 @@ def main():
if args.uri is not None:
vm = Struct()
vm.protocol, vm.user, vm.password, vm.host, vm.port = \
args.uri.split(':',4)
args.uri.split(':', 4)
vm.protocol = vm.protocol.upper()
vm.state = "RUN"
else:
......
......@@ -136,7 +136,7 @@ class NXKeyGen:
sRet = sRet + c2
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
"""
......
......@@ -17,6 +17,7 @@ try:
except ImportError:
from OrderedDict import * # noqa
def parse_arguments():
"""
Argument parser, based on argparse module
......@@ -27,8 +28,8 @@ def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument(
"-d", "--driver",
help="Select webdriver. Aside from Firefox, you have to install "+
"first the proper driver.", type=str, default="firefox",
help="Select webdriver. Aside from Firefox, you have to install "
+ "first the proper driver.", type=str, default="firefox",
required=False, choices=['firefox', 'chrome',
'iexplore', 'opera'])
if windowsclasses.DecideArchitecture.Is64Windows():
......
......@@ -149,8 +149,8 @@ class RegistryHandler:
temp_dict, False, architect, needed_rights)
else:
if isinstance(value, list):
if len(value)%2 != 0:
#print "Not enough member in the list"
if len(value) % 2 != 0:
# print "Not enough member in the list"
raise AttributeError
else:
new_key = CreateKeyEx(
......@@ -173,7 +173,7 @@ class RegistryHandler:
print "The provided attribute wasn't a dictionary chain"
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
Can raise KeyError if key is not found in the registry
......@@ -234,11 +234,11 @@ class RegistryHandler:
combinations as keys and values
"""
if depth == "key":
int_depth = 0;
int_depth = 0
elif depth == "subkeys":
int_depth = 1;
int_depth = 1
elif depth == "all":
int_depth = 2;
int_depth = 2
else:
raise AttributeError
try:
......
......@@ -47,10 +47,10 @@ def parse_arguments():
parser.add_argument("-p", "--password", type=str)
parser.add_argument(
"-d", "--driver",
help = "Select webdriver. Aside from Firefox, you have to install "+
"first the proper driver.", type=str,
choices = ['firefox', 'chrome', 'ie', 'opera'],
default = "firefox")
help="Select webdriver. Aside from Firefox, you have to install "
+ "first the proper driver.", type=str,
choices=['firefox', 'chrome', 'ie', 'opera'],
default="firefox")
args = parser.parse_args()
return args
......@@ -108,7 +108,7 @@ class Browser:
vm.state, vm.protocol = "", "NONE"
try:
while vm.state.upper()[:3] not in ("FUT", "RUN"):
element = WebDriverWait(driver,7200).until(
WebDriverWait(driver, 7200).until(
EC.presence_of_element_located((
By.CSS_SELECTOR,
"#vm-details-pw-eye.fa.fa-eye-slash")))
......@@ -132,6 +132,7 @@ class Browser:
raise
return vm
def main():
"""
Main program
......@@ -141,7 +142,7 @@ def main():
if args.uri is not None:
vm = Struct()
vm.protocol, vm.user, vm.password, vm.host, vm.port = \
args.uri.split(':',4)
args.uri.split(':', 4)
vm.protocol = vm.protocol.upper()
vm.state = "RUN"
else:
......
......@@ -136,7 +136,7 @@ class NXKeyGen:
sRet = sRet + c2
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
"""
......
......@@ -17,6 +17,7 @@ try:
except ImportError:
from OrderedDict import * # noqa
def parse_arguments():
"""
Argument parser, based on argparse module
......@@ -27,8 +28,8 @@ def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument(
"-d", "--driver",
help="Select webdriver. Aside from Firefox, you have to install "+
"first the proper driver.", type=str, default="firefox",
help="Select webdriver. Aside from Firefox, you have to install "
+ "first the proper driver.", type=str, default="firefox",
required=False, choices=['firefox', 'chrome',
'iexplore', 'opera'])
if windowsclasses.DecideArchitecture.Is64Windows():
......
......@@ -149,8 +149,8 @@ class RegistryHandler:
temp_dict, False, architect, needed_rights)
else:
if isinstance(value, list):
if len(value)%2 != 0:
#print "Not enough member in the list"
if len(value) % 2 != 0:
# print "Not enough member in the list"
raise AttributeError
else:
new_key = CreateKeyEx(
......@@ -173,7 +173,7 @@ class RegistryHandler:
print "The provided attribute wasn't a dictionary chain"
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
Can raise KeyError if key is not found in the registry
......@@ -234,11 +234,11 @@ class RegistryHandler:
combinations as keys and values
"""
if depth == "key":
int_depth = 0;
int_depth = 0
elif depth == "subkeys":
int_depth = 1;
int_depth = 1
elif depth == "all":
int_depth = 2;
int_depth = 2
else:
raise AttributeError
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