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
3cb9d3e3
authored
Jul 07, 2014
by
Csók Tamás
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correction in cloud.py and a windows icon for windows
parent
782c01ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
23 deletions
+28
-23
dist/cloud.ico
+0
-0
dist/cloud.py
+28
-23
No files found.
dist/cloud.ico
0 → 100644
View file @
3cb9d3e3
File added
dist/cloud.py
View file @
3cb9d3e3
...
@@ -34,7 +34,7 @@ def pars_arguments():
...
@@ -34,7 +34,7 @@ def pars_arguments():
parser
.
add_argument
(
"-u"
,
"--username"
,
type
=
str
)
parser
.
add_argument
(
"-u"
,
"--username"
,
type
=
str
)
parser
.
add_argument
(
"-p"
,
"--password"
,
type
=
str
)
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."
,
\
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'
,
'safari'
],
default
=
"firefox"
)
type
=
str
,
choices
=
[
'firefox'
,
'chrome'
,
'ie'
,
'opera'
],
default
=
"firefox"
)
parser
.
add_argument
(
"-o"
,
"--old"
,
help
=
"Use old interface"
,
action
=
"store_true"
)
parser
.
add_argument
(
"-o"
,
"--old"
,
help
=
"Use old interface"
,
action
=
"store_true"
)
args
=
parser
.
parse_args
();
args
=
parser
.
parse_args
();
return
args
return
args
...
@@ -54,8 +54,6 @@ class Browser:
...
@@ -54,8 +54,6 @@ class Browser:
self
.
driver
=
webdriver
.
Ie
()
self
.
driver
=
webdriver
.
Ie
()
elif
args
.
driver
==
"opera"
:
elif
args
.
driver
==
"opera"
:
self
.
driver
=
webdriver
.
Opera
()
self
.
driver
=
webdriver
.
Opera
()
elif
args
.
driver
==
"safari"
:
self
.
driver
=
webdriver
.
Safari
()
self
.
driver
.
implicitly_wait
(
10
)
self
.
driver
.
implicitly_wait
(
10
)
##
##
...
@@ -96,6 +94,7 @@ class Browser:
...
@@ -96,6 +94,7 @@ class Browser:
driver
.
find_element_by_css_selector
(
"a[href*='/logout/']"
)
.
click
()
driver
.
find_element_by_css_selector
(
"a[href*='/logout/']"
)
.
click
()
except
:
except
:
print
"Browser session timed out!"
print
"Browser session timed out!"
raise
return
vm
return
vm
##
##
...
@@ -127,6 +126,7 @@ class Browser:
...
@@ -127,6 +126,7 @@ class Browser:
driver
.
find_element_by_css_selector
(
"a[href*='/logout/']"
)
.
click
()
driver
.
find_element_by_css_selector
(
"a[href*='/logout/']"
)
.
click
()
except
:
except
:
print
"Browser session timed out!"
print
"Browser session timed out!"
raise
return
vm
return
vm
##
##
...
@@ -138,25 +138,30 @@ class Browser:
...
@@ -138,25 +138,30 @@ class Browser:
# kapcsolódunk a klienshez
# kapcsolódunk a klienshez
def
main
():
def
main
():
args
=
pars_arguments
()
try
:
if
args
.
uri
is
not
None
:
args
=
pars_arguments
()
vm
=
Struct
()
if
args
.
uri
is
not
None
:
vm
.
protocol
,
vm
.
user
,
vm
.
password
,
vm
.
host
,
vm
.
port
=
args
.
uri
.
split
(
':'
,
4
)
vm
=
Struct
()
vm
.
protocol
=
vm
.
protocol
.
upper
()
vm
.
protocol
,
vm
.
user
,
vm
.
password
,
vm
.
host
,
vm
.
port
=
args
.
uri
.
split
(
':'
,
4
)
vm
.
state
=
"RUN"
vm
.
protocol
=
vm
.
protocol
.
upper
()
else
:
vm
.
state
=
"RUN"
browser
=
Browser
(
args
)
else
:
if
args
.
old
:
browser
=
Browser
(
args
)
vm
=
browser
.
old_main
()
try
:
else
:
if
args
.
old
:
vm
=
browser
.
main
()
vm
=
browser
.
old_main
()
browser
.
driver
.
quit
()
else
:
if
platform
.
system
()
==
"Linux"
:
vm
=
browser
.
main
()
from
cloud_connect_from_linux
import
connect
browser
.
driver
.
quit
()
elif
platform
.
system
()
==
"Windows"
:
except
:
from
cloud_connect_from_windows
import
connect
raise
if
vm
.
state
.
upper
()[:
3
]
in
(
"FUT"
,
"RUN"
):
if
platform
.
system
()
==
"Linux"
:
connect
(
vm
)
from
cloud_connect_from_linux
import
connect
elif
platform
.
system
()
==
"Windows"
:
from
cloud_connect_from_windows
import
connect
if
vm
.
state
.
upper
()[:
3
]
in
(
"FUT"
,
"RUN"
):
connect
(
vm
)
except
:
pass
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
main
()
main
()
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