Commit 5c801047 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Windows installation guide

parent 84b79bf0
......@@ -6,7 +6,7 @@ This guide describes the standard installation process for kamaki, with the aspi
* Kamaki repository: `http://code.grnet.gr/git/kamaki <http://code.grnet.gr/git/kamaki>`_
* Synnefo Linux packages: `http://apt.dev.grnet.gr <http://apt.dev.grnet.gr>`_
* Synnefo Linux packages: `http://apt.dev.grnet.gr <http://apt.dev.grnet.gr>`_, `http://apt2.dev.grnet.gr <http://apt2.dev.grnet.gr>`_
Linux and Unix-like enviroments
-------------------------------
......@@ -157,4 +157,94 @@ Kamaki can be installed on Mac OS X systems from source, by following the steps
Windows
-------
Since version 0.6.2 kamaki can run on Windows, either on standard Windows console, or inside an improved command line shell.
Since version 0.6.2 kamaki can run on Windows, either on standard Windows console, or inside an improved command line shell. The present guide presents a tested method for using kamaki in windows
Requirements
^^^^^^^^^^^^
* Python 2.7 or better (Official versions `here <http://www.python.org/getit>`_)
* Git (download `windows version <http://git-scm.com/download/win>`_)
* Setuptools (Official versions and workarrounds `here <http://pypi.python.org/pypi/setuptools>`_)
Installation from source
^^^^^^^^^^^^^^^^^^^^^^^^
Install python
""""""""""""""
Download and run the Windows installer from `here <http://www.python.org/getit>`_
Users should pick the installer that fits their windows version and architecture.
Add python to windows path
""""""""""""""""""""""""""
The following will allow users to run python and python scripts from command line.
* Select **System** from the Control Panel, select the **Advanced** tab, the **Environment Variables** button and then find the **PATH** (user or system) and **edit**
* Without removing existing values, append the following to PATH:
C:\Python;C:\Python\Scripts
.. note:: Path values are separated by a semicolons
.. warning:: C:\Python should be replaced with the actual python path in the system, e.g. C:\Python27
Install setuptools
""""""""""""""""""
According to the corresponding `python.org page <http://pypi.python.org/pypi/setuptools>`_, the setuptools installer doesn't currently work on 64bit machines.
* Users with 32-bit operating systems should download and run the graphic installer
* Users with 64-bit machines should download the `ez_setup.py <http://peak.telecommunity.com/dist/ez_setup.py>`_ script and install it from a command shell. In the following, the script is downloaded at C:\Downloads::
C:\> cd Downloads
C:\Downloads\> python ez_setup.py
...
Installation finished
C:\Downloads\>
Install GIT
"""""""""""
Download GIT from `here <http://git-scm.com/download/win>`_ and run the graphic installer. During the installation, users will be able to modify some installation options. The present guide is tested with the default selections.
After the installation is completed, a GIT standalone shell will be installed (a desktop shortcut is created, by default). Users are advised to run kamaki through this shell.
Install kamaki
""""""""""""""
* Run the GIT standalone shell
* Enter the location where kamaki will be installed, e.g. *C\:*
.. code-block:: console
$ cd /c/
* Download source from GRNET repository
.. code-block:: console
$ git clone http://code.grnet.gr/git/kamaki
Cloning into 'kamaki'...
Receiving objects: ...
Resolving Deltas: ...
* Enter source and install kamaki
.. code-block:: console
$ cd kamaki
$ python setup.py install
running install
...
Finished processing dependencies for kamaki==0.6.2
.. warning:: kamaki version should be 0.6.2 or better, otherwise it will not function. Users can test that by running::
$ kamaki --version
# Copyright 2011-2012 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, self.list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, self.list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
class HTTPResponse(object):
"""An abstract HTTP Response object to handle a performed HTTPRequest.
Subclass implementation required
"""
def __init__(self, request=None, prefetched=False):
self.request = request
self.prefetched = prefetched
def _get_response(self):
"""Wait for http response as late as possible: the first time needed"""
if self.prefetched:
return
self = self.request.response
self.prefetched = True
def release(self):
"""Release the connection.
"""
raise NotImplementedError
@property
def prefetched(self):
"""flag to avoid downloading more than nessecary"""
return self._prefetched
@prefetched.setter
def prefetched(self, p):
self._prefetched = p
@property
def content(self):
"""(binary) request response content (data)"""
self._get_response()
return self._content
@content.setter
def content(self, v):
self._content = v
@property
def text(self):
"""(str)"""
self._get_response()
return self._text
@text.setter
def text(self, v):
self._text = v
@property
def json(self):
"""(dict)"""
self._get_response()
return self._json
@json.setter
def json(self, v):
self._json = v
@property
def headers(self):
"""(dict)"""
self._get_response()
return self._headers
@headers.setter
def headers(self, v):
self._headers = v
@property
def status_code(self):
"""(int) optional"""
self._get_response()
return self._status_code
@status_code.setter
def status_code(self, v):
self._status_code = v
@property
def status(self):
"""(str) useful in server error responses"""
self._get_response()
return self._status
@status.setter
def status(self, v):
self._status = v
@property
def request(self):
"""(HTTPConnection) the source of this response object"""
return self._request
@request.setter
def request(self, v):
self._request = v
class HTTPConnection(object):
"""An abstract HTTP Connection mechanism. Subclass implementation required
"""
def __init__(self, method=None, url=None, params={}, headers={}):
self.headers = headers
self.params = params
self.url = url
self.path = ''
self.method = method
def set_header(self, name, value):
self.headers[unicode(name)] = unicode(value)
def remove_header(self, name):
try:
self.headers.pop(name)
except KeyError:
pass
def replace_headers(self, new_headers):
self.headers = new_headers
def reset_headers(self):
self.replace_headers({})
def set_param(self, name, value=None):
self.params[name] = value
def remove_param(self, name):
try:
self.params.pop(name)
except KeyError:
pass
def replace_params(self, new_params):
self.params = new_params
def reset_params(self):
self.replace_params({})
def set_url(self, url):
self.url = url
def set_path(self, path):
self.path = path
def set_method(self, method):
self.method = method
def perform_request(self,
method=None,
url=None,
async_headers={},
async_params={},
data=None):
raise NotImplementedError
# Copyright 2012 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, self.list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, self.list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
class HTTPConnectionError(Exception):
def __init__(self, message):
super(HTTPConnectionError, self).__init__(message)
class HTTPResponseError(Exception):
def __init__(self, message):
super(HTTPResponseError, self).__init__(message)
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 to comment