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
ecfb7753
authored
Sep 11, 2014
by
Csók Tamás
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: more debianic layout
parent
2a687b20
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
49 deletions
+71
-49
CIRCLE Client.desktop
+5
-5
cloud
+58
-29
cloud2
+0
-10
cloud_connect_from_linux
+0
-0
debian/changelog
+1
-1
debian/control
+4
-3
setup.py
+3
-1
No files found.
cloud
.desktop
→
CIRCLE Client
.desktop
View file @
ecfb7753
[Desktop Entry]
Encoding=UTF-8
Version=0.
2
Version=0.
1
Type=Application
Name=C
loud GUI
Comment=Tool to
use IK
Cloud
Exec=cloud
2
%u
Icon=
/usr/share/icons/cloud.svg
Name=C
IRCLE Client
Comment=Tool to
enhance the use of the CIRCLE
Cloud
Exec=cloud %u
Icon=
cloud
Terminal=true
MimeType=x-scheme-handler/circle;
Categories=Utility;Application;
cloud
.py
→
cloud
View file @
ecfb7753
...
...
@@ -8,6 +8,8 @@ The Client job is to help the ease of use of the cloud system.
import
platform
import
argparse
import
imp
import
os
try
:
from
selenium
import
webdriver
from
selenium.webdriver.common.by
import
By
...
...
@@ -32,31 +34,6 @@ class Struct:
pass
def
parse_arguments
():
"""
Argument parser, based on the argparse module
Keyword arguments:
@return args -- arguments given by console
"""
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"uri"
,
type
=
str
,
help
=
"Specific schema handler"
,
nargs
=
'?'
,
default
=
None
)
parser
.
add_argument
(
"-u"
,
"--username"
,
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."
),
type
=
str
,
choices
=
[
'firefox'
,
'chrome'
,
'ie'
,
'opera'
],
default
=
"firefox"
)
args
=
parser
.
parse_args
()
return
args
class
Browser
:
"""
Browser initialisation
...
...
@@ -119,7 +96,7 @@ class Browser:
# cl: connection string converted to list
cl
=
driver
.
find_element_by_css_selector
(
"#vm-details-connection-string"
)
.
get_attribute
(
"value"
)
.
split
()
"value"
)
.
split
()
if
cl
[
0
]
==
"sshpass"
:
vm
.
protocol
=
"SSH"
vm
.
user
,
vm
.
host
=
cl
[
6
]
.
split
(
"@"
)
...
...
@@ -135,6 +112,57 @@ class Browser:
return
vm
def
load_from_file
(
uri
,
absl
=
False
):
if
not
absl
:
uri
=
os
.
path
.
normpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
uri
))
path
,
fname
=
os
.
path
.
split
(
uri
)
mname
,
ext
=
os
.
path
.
splitext
(
fname
)
no_ext
=
os
.
path
.
join
(
path
,
mname
)
if
os
.
path
.
exists
(
no_ext
+
'.pyc'
):
try
:
return
imp
.
load_compiled
(
mname
,
no_ext
+
'.pyc'
)
except
:
pass
elif
os
.
path
.
exists
(
no_ext
+
'.py'
):
try
:
return
imp
.
load_source
(
mname
,
no_ext
+
'.py'
)
except
:
pass
elif
os
.
path
.
exists
(
no_ext
):
try
:
return
imp
.
load_source
(
mname
,
no_ext
)
except
:
try
:
return
imp
.
load_compiled
(
mname
,
no_ext
)
except
:
pass
def
parse_arguments
():
"""
Argument parser, based on the argparse module
Keyword arguments:
@return args -- arguments given by console
"""
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"uri"
,
type
=
str
,
help
=
"Specific schema handler"
,
nargs
=
'?'
,
default
=
None
)
parser
.
add_argument
(
"-u"
,
"--username"
,
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."
),
type
=
str
,
choices
=
[
'firefox'
,
'chrome'
,
'ie'
,
'opera'
],
default
=
"firefox"
)
args
=
parser
.
parse_args
()
return
args
def
main
():
"""
Main program
...
...
@@ -151,12 +179,13 @@ def main():
browser
=
Browser
(
args
)
vm
=
browser
.
main
()
browser
.
driver
.
quit
()
if
platform
.
system
()
==
"Linux"
:
from
cloud_connect_from_linux
import
connect
connect
=
load_from_file
(
"cloud_connect_from_linux"
)
elif
platform
.
system
()
==
"Windows"
:
from
cloud_connect_from_windows
import
connect
connect
=
load_from_file
(
"cloud_connect_from_windows"
)
if
vm
.
state
.
upper
()[:
3
]
in
(
"FUT"
,
"RUN"
):
connect
(
vm
)
connect
.
connect
(
vm
)
except
:
print
"Unknown error occurred! Please contact the developers!"
...
...
cloud2
deleted
100644 → 0
View file @
2a687b20
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import
cloud
if
__name__
==
'__main__'
:
try
:
cloud
.
main
()
finally
:
pass
cloud_connect_from_linux
.py
→
cloud_connect_from_linux
View file @
ecfb7753
File moved
debian/changelog
View file @
ecfb7753
circle-client (0.1) trusty; urgency=medium
* Initial release.
(Closes: #XXXXXX)
* Initial release.
-- Csók Tamás <godhak@gmail.com> Wed, 10 Sep 2014 15:57:26 +0200
debian/control
View file @
ecfb7753
...
...
@@ -2,13 +2,14 @@ Source: circle-client
Section: embedded
Priority: optional
Maintainer: Csók Tamás <godhak@gmail.com>
Build-Depends: debhelper (>= 9.20~), python (>= 2.7~), python-support (>= 1.0.15~), cdbs (>= 0.4.122~), python-all-dev, libglib2.0-dev (>=2.40~), libgtk2.0-dev (>=2.24.23~), libgcrypt11-dev (>= 1.5.3~), python-dev (>= 2.7
.5
~)
Build-Depends: debhelper (>= 9.20~), python (>= 2.7~), python-support (>= 1.0.15~), cdbs (>= 0.4.122~), python-all-dev, libglib2.0-dev (>=2.40~), libgtk2.0-dev (>=2.24.23~), libgcrypt11-dev (>= 1.5.3~), python-dev (>= 2.7~)
Standards-Version: 3.9.5
Package: circle-client
Architecture: all
Architecture: any
Multi-Arch: foreign
Homepage: http://circlecloud.org/
Depends: ${misc:Depends}, ${python:Depends}, sshpass (>= 1.05~), remmina (>=1.0.0~), remmina-plugin-nx (>= 1.0.0~), remmina-plugin-rdp (>= 1.0.0~), python (>= 2.7~)
Depends: ${misc:Depends}, ${python:Depends},
${shlibs:Depends},
sshpass (>= 1.05~), remmina (>=1.0.0~), remmina-plugin-nx (>= 1.0.0~), remmina-plugin-rdp (>= 1.0.0~), python (>= 2.7~)
Description: Connectivity helper for CIRCLE cloud system
Tool to enhance ease of use of the CIRCLE Cloud by the
use of third party connetcion handler programs. These
...
...
setup.py
View file @
ecfb7753
...
...
@@ -48,6 +48,8 @@ setup(name='CIRCLE Client',
platforms
=
[
'linux2'
,
'posix'
],
data_files
=
[(
'/usr/share/icons'
,
[
'cloud.svg'
]),
(
'/usr/share/applications'
,
[
'CIRCLE Client.desktop'
])],
description
=
'Connectivity helper for CIRCLE cloud system'
,
long_description
=
(
'Tool to enhance ease of use of the CIRCLE by '
...
...
@@ -59,7 +61,7 @@ setup(name='CIRCLE Client',
maintainer
=
'BME IK'
,
maintainer_email
=
'cloud@ik.bme.hu'
,
url
=
'http://circlecloud.org/'
,
scripts
=
[
'cloud
.py'
,
'cloud2'
,
'cloud_connect_from_linux.py
'
],
scripts
=
[
'cloud
'
,
'cloud_connect_from_linux
'
],
classifiers
=
[
'Development Status :: 4 - Beta'
,
'Environment :: Web Environment'
,
...
...
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