Commit ecfb7753 by Csók Tamás

client: more debianic layout

parent 2a687b20
[Desktop Entry]
Encoding=UTF-8
Version=0.2
Version=0.1
Type=Application
Name=Cloud GUI
Comment=Tool to use IK Cloud
Exec=cloud2 %u
Icon=/usr/share/icons/cloud.svg
Name=CIRCLE 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;
......@@ -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
......@@ -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!"
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cloud
if __name__ == '__main__':
try:
cloud.main()
finally:
pass
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
......@@ -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
......
......@@ -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',
......
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