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
07f24ea9
authored
Sep 24, 2014
by
Csók Tamás
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: flake8 correction
parent
c7a5e821
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
18 deletions
+19
-18
src/nsi/installer/cloud_connect_from_windows.py
+8
-8
src/nsi/installer/ez_setup.py
+1
-0
src/nsi/installer/pywin_installer.py
+4
-3
src/nsi/installer/win_install.py
+6
-7
No files found.
src/nsi/installer/cloud_connect_from_windows.py
View file @
07f24ea9
...
...
@@ -31,10 +31,10 @@ def connect(vm):
if
vm
.
protocol
==
"SSH"
:
arguments
=
(
"-ssh -P
%(port)
s -pw
%(password)
s"
"
%(user)
s@
%(host)
s"
%
{
'port'
:
vm
.
port
,
'password'
:
vm
.
password
,
'user'
:
vm
.
user
,
'host'
:
vm
.
host
})
'port'
:
vm
.
port
,
'password'
:
vm
.
password
,
'user'
:
vm
.
user
,
'host'
:
vm
.
host
})
directory
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
subprocess
.
Popen
(
"
%(path)
s
\\
putty.exe
%(arguments)
s"
%
{
'path'
:
directory
,
...
...
@@ -52,7 +52,7 @@ def connect(vm):
break
if
not
found
:
config_file
=
"
%
s
%
s
%
s"
%
(
os
.
path
.
expanduser
(
"~
\\
.nx
\\
config
\\
"
),
str
(
int
(
time
.
time
()
*
1000
)),
".nxs"
)
str
(
int
(
time
.
time
()
*
1000
)),
".nxs"
)
password
=
nxkey
.
NXKeyGen
(
vm
.
password
)
.
getEncrypted
()
config
=
NX_template
%
{
'USERNAME'
:
vm
.
user
,
'PASSWORD'
:
password
,
'HOST'
:
vm
.
host
,
'PORT'
:
vm
.
port
}
...
...
@@ -61,7 +61,7 @@ def connect(vm):
f
.
close
()
subprocess
.
Popen
(
config_file
,
shell
=
True
)
elif
vm
.
protocol
==
"RDP"
:
listdir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
"
\\
.rdp
\\
*.rdp"
listdir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
"
\\
.rdp
\\
*.rdp"
found
=
False
full_address
=
"full address:s:
%
s:
%
s"
%
(
vm
.
host
,
vm
.
port
)
user
=
"username:s:
%
s"
%
vm
.
user
...
...
@@ -73,8 +73,8 @@ def connect(vm):
break
if
not
found
:
config_file
=
"
%
s
%
s
%
s"
%
((
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
"
\\
.rdp
\\
"
),
str
(
int
(
time
.
time
()
*
1000
)),
".rdp"
)
os
.
path
.
realpath
(
__file__
))
+
"
\\
.rdp
\\
"
),
str
(
int
(
time
.
time
()
*
1000
)),
".rdp"
)
password
=
binascii
.
hexlify
(
win32crypt
.
CryptProtectData
(
u"
%
s"
%
vm
.
password
,
u'psw'
,
None
,
None
,
None
,
0
))
config
=
RPD_template
%
{
'USERNAME'
:
vm
.
user
,
'PASSWORD'
:
password
,
...
...
src/nsi/installer/ez_setup.py
View file @
07f24ea9
#!/usr/bin/env python
# flake8: noqa
"""Bootstrap setuptools installation
To use setuptools in your package's setup.py, include this
...
...
src/nsi/installer/pywin_installer.py
View file @
07f24ea9
...
...
@@ -22,7 +22,8 @@ def parse_arguments():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"change_architect"
,
type
=
str
,
help
=
"Whether the 32 bit Python version is installed on a 64bit system"
,
help
=
(
"Whether the 32 bit Python version"
"is installed on a 64bit system"
),
nargs
=
'?'
,
default
=
False
)
args
=
parser
.
parse_args
()
return
args
...
...
@@ -46,7 +47,7 @@ def main():
pywin32_version
=
str
(
219
)
if
sys
.
hexversion
<
0x02070000
:
if
(
windowsclasses
.
DecideArchitecture
.
Is64Windows
()
and
not
args
.
change_architect
):
and
not
args
.
change_architect
):
subprocess
.
Popen
(
"
%
s
\\
x64
\\
pywin32-
%
s.win-amd64-py2.6.exe"
%
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
...
...
@@ -58,7 +59,7 @@ def main():
pywin32_version
))
.
wait
()
elif
sys
.
hexversion
<
0x02080000
:
if
(
windowsclasses
.
DecideArchitecture
.
Is64Windows
()
and
not
args
.
change_architect
):
and
not
args
.
change_architect
):
subprocess
.
Popen
(
"
%
s
\\
x64
\\
pywin32-
%
s.win-amd64-py2.7.exe"
%
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
...
...
src/nsi/installer/win_install.py
View file @
07f24ea9
...
...
@@ -71,7 +71,7 @@ def custom_protocol_register(custom_protocol):
"""
if
not
isinstance
(
custom_protocol
,
OrderedDict
):
raise
AttributeError
print
"
\t
"
+
custom_protocol
.
iterkeys
()
.
next
()
print
"
\t
"
+
custom_protocol
.
iterkeys
()
.
next
()
try
:
custom_arguments
=
windowsclasses
.
Struct
()
custom_arguments
.
registry
=
"HKCR"
...
...
@@ -115,10 +115,10 @@ def main():
location
=
os
.
path
.
join
(
desktop_path
,
"CIRCLE Client.url"
)
shortcut
=
file
(
location
,
'w'
)
shortcut
.
write
(
'[InternetShortcut]
\n
'
)
shortcut
.
write
(
'URL='
+
args
.
target
)
shortcut
.
write
(
'URL='
+
args
.
target
)
shortcut
.
close
()
else
:
shortcut
.
SetPath
(
args
.
location
+
"cloud.py"
)
shortcut
.
SetPath
(
args
.
location
+
"cloud.py"
)
if
args
.
driver
==
"chrome"
:
shortcut
.
SetArguments
(
"-d chrome"
)
elif
args
.
driver
==
"iexplore"
:
...
...
@@ -126,7 +126,7 @@ def main():
elif
args
.
driver
==
"opera"
:
shortcut
.
SetArguments
(
"-d opera"
)
shortcut
.
SetDescription
(
"Tool to use CIRCLE Cloud"
)
shortcut
.
SetIconLocation
(
args
.
location
+
"cloud.ico"
,
0
)
shortcut
.
SetIconLocation
(
args
.
location
+
"cloud.ico"
,
0
)
desktop_path
=
shell
.
SHGetFolderPath
(
0
,
shellcon
.
CSIDL_DESKTOP
,
0
,
0
)
persist_file
=
shortcut
.
QueryInterface
(
...
...
@@ -143,7 +143,7 @@ def main():
"URL Protocol"
,
""
]),
(
'circle
\\
URL Protocol'
,
""
),
(
'circle
\\
DefaultIcon'
,
args
.
location
+
"cloud.ico"
),
(
'circle
\\
DefaultIcon'
,
args
.
location
+
"cloud.ico"
),
(
'circle
\\
shell'
,
{
'open'
:
{
'command'
:
(
"
\"
%(prefix)
s
\
pythonw.exe
\"
"
...
...
@@ -151,8 +151,7 @@ def main():
"cloud.py
\"
"
%
{
'prefix'
:
sys
.
exec_prefix
,
'location'
:
args
.
location
}
+
r'"
%1
"'
)
}
+
r'"
%1
"'
)
}})
])
custom_protocol_register
(
custom_protocol
)
...
...
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