Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4026505c
authored
Sep 03, 2014
by
Csók Tamás
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: few flake8 correction
parent
1fa0050b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
30 deletions
+34
-30
src/iss/installer/cloud.py
+7
-6
src/iss/installer/nxkey.py
+1
-1
src/iss/installer/win_install.py
+3
-2
src/iss/installer/windowsclasses.py
+6
-6
src/python/cloud.py
+7
-6
src/python/nxkey.py
+1
-1
src/python/win_install.py
+3
-2
src/python/windowsclasses.py
+6
-6
No files found.
src/iss/installer/cloud.py
View file @
4026505c
...
@@ -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
:
...
...
src/iss/installer/nxkey.py
View file @
4026505c
...
@@ -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
"""
"""
...
...
src/iss/installer/win_install.py
View file @
4026505c
...
@@ -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
():
...
...
src/iss/installer/windowsclasses.py
View file @
4026505c
...
@@ -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
:
...
...
src/python/cloud.py
View file @
4026505c
...
@@ -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
:
...
...
src/python/nxkey.py
View file @
4026505c
...
@@ -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
"""
"""
...
...
src/python/win_install.py
View file @
4026505c
...
@@ -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
():
...
...
src/python/windowsclasses.py
View file @
4026505c
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment