[X2go-Commits] pyhoca-cli.git - build-main (branch) updated: 0.1.4.2-15-gb91f7d8

X2Go dev team git-admin at x2go.org
Fri Jun 8 23:14:48 CEST 2012


The branch, build-main has been updated
       via  b91f7d899a80c5c377e4ddfdfdf2c7b9904f2c54 (commit)
       via  3816f7dc6ab7f0f0fffa652d3d8d5086fdf0539c (commit)
       via  a7e4fe050770a7082ec89b46e30a263856f0c6ce (commit)
       via  1bcc08fb10945c8d9d3c59714cd9622adc17745c (commit)
       via  b7fa23be3f50174817a11036b085ad8a54ba7f99 (commit)
       via  9f561faf26e0828f77e078d122d9880520aadbb3 (commit)
       via  fe3fea0defb27ae346f115dd3891c36581db6d17 (commit)
       via  c522c0a7e5bce527de073a51db4adb165f3e9d69 (commit)
       via  9c63db33b0b31598afb9c0dee92131649c93528b (commit)
       via  c9127546eb02e1633969f363697a98c009e6a386 (commit)
       via  844198f8829e6d23d69ffa9bc092ca560ab73c35 (commit)
       via  a92896977c367567119f309411cff500fea1dbaf (commit)
       via  d33f8630e4104fa08703a0bad4c052084fdef696 (commit)
       via  c989f6146515ead9c38460c0057aae4881dce102 (commit)
       via  9f2b5bd5166de95c3873500a790813c8f058870d (commit)
      from  6225f29139d86cb730453772e5a0a07c1e7da9c8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 LICENSE.txt            |  661 ++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.docupload     |    2 +-
 README                 |    8 +-
 TODO                   |    4 +-
 debian/changelog       |   29 ++-
 debian/control         |   11 +-
 debian/copyright       |   30 ++-
 debian/rules           |    2 +-
 man/man1/pyhoca-cli.1  |   44 ++--
 pyhoca-cli             |  103 +++++---
 pyhoca/__init__.py     |    8 +-
 pyhoca/cli/__init__.py |   17 +-
 pyhoca/cli/frontend.py |  160 ++++++++----
 setup.py               |   14 +-
 14 files changed, 940 insertions(+), 153 deletions(-)
 create mode 100644 LICENSE.txt

The diff of changes is:
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..dba13ed
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,661 @@
+                    GNU AFFERO GENERAL PUBLIC LICENSE
+                       Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+  The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+  An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU Affero General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Remote Network Interaction; Use with the GNU General Public License.
+
+  Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
diff --git a/Makefile.docupload b/Makefile.docupload
index 1a6c71d..825b319 100644
--- a/Makefile.docupload
+++ b/Makefile.docupload
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 # Makefile.docupload file - for pyhoca-cli
-# Copyright 2010-2011 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>, GPLv3 applies to this file
+# Copyright 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>, AGPLv3+ applies to this file
 
 VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1`
 DOC_HOST=code.x2go.org
diff --git a/README b/README
index 5c9985f..f513376 100644
--- a/README
+++ b/README
@@ -1,10 +1,10 @@
-pyhoca-cli - Copyright (C) 2010-2011 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+pyhoca-cli - Copyright (C) 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 
 Contributors:
     Jörg Sawatzki <joerg.sawatzki at web.de>
     Dick Kniep <dick.kniep at lindix.nl>
 
-Published under the terms of the GNU General Public License.
+Published under the terms of the GNU Affero General Public License.
 See http://www.gnu.org/licenses/gpl.html for a recent copy.
 
 
@@ -20,8 +20,8 @@ See http://www.gnu.org/licenses/gpl.html for a recent copy.
 
 === Current features ===
 
-* start a new session on an X2go server
-* resume a suspended session on an X2go server
+* start a new session on an X2Go server
+* resume a suspended session on an X2Go server
 * suspend a running session (hit Ctrl+C)
 * terminate a running session 
 * retrieve a list of running sessions
diff --git a/TODO b/TODO
index 93bcd20..685f653 100644
--- a/TODO
+++ b/TODO
@@ -1,10 +1,10 @@
-pyhoca-cli - Copyright (C) 2010-2011 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+pyhoca-cli - Copyright (C) 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 
 Contributors:
     Jörg Sawatzki <joerg.sawatzki at web.de>
     Dick Kniep <dick.kniep at lindix.nl>
 
-Published under the terms of the GNU General Public License.
+Published under the terms of the GNU Affero General Public License.
 See http://www.gnu.org/licenses/gpl.html for a recent copy.
 
 
diff --git a/debian/changelog b/debian/changelog
index 0ff89d5..9e10400 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+pyhoca-cli (0.2.0.0-0~x2go1) unstable; urgency=low
+
+  * New upstream version (0.2.0.0):
+    - Replace non-code strings ,,X2go'' by ,,X2Go''.
+    - Add code to redirect stdout and stderr when frozen with py2exe.
+  * Add python-suport (>= 0.90) as dependency. Fix project name in control
+    file.
+  * Add proper license to copyright file.
+  * Add __doc__ strings to __init__.py and frontend.py.
+  * Depend on Python X2Go (>= 0.2.0.2).
+
+ -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Fri, 08 Jun 2012 23:14:20 +0200
+
 pyhoca-cli (0.1.4.2-0~x2go1) unstable; urgency=low
 
   * New upstream version (0.1.4.2):
@@ -25,14 +38,14 @@ pyhoca-cli (0.1.4.0-0~x2go2) unstable; urgency=low
 
   * Already prepare for new upstream version (0.1.4.1):
     - README/TODO update.
-  * Depend on Python X2go 0.1.1.2.
+  * Depend on Python X2Go 0.1.1.2.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Tue, 05 Jul 2011 21:22:28 +0200
 
 pyhoca-cli (0.1.4.0-0~x2go4) unstable; urgency=low
 
   * New upstream version (0.1.4.0):
-    - Add X2go desktop sharing support.
+    - Add X2Go desktop sharing support.
     - Terminate shared desktop sessions of Ctrl-C (instead of 
       suspending them.
   * React to bug #627990, prefer man2html-base over man2html.
@@ -49,7 +62,7 @@ pyhoca-cli (0.1.3.3-0~x2go1) unstable; urgency=low
 
   * new upstream version (0.1.3.3):
     - adds man page in html format
-  * depending on new Python X2go version (0.1.0.0)
+  * depending on new Python X2Go version (0.1.0.0)
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 26 May 2011 12:05:11 +0200
 
@@ -81,14 +94,14 @@ pyhoca-cli (0.1.3.0-0~nwt1) unstable; urgency=low
 
 pyhoca-cli (0.1.3-0~nwt2) lucid maverick testing unstable; urgency=low
 
-  * update Python X2go dependency
+  * update Python X2Go dependency
   * added python-setproctitle as dependency
 
  -- Mike Gabriel <m.gabriel at das-netzwerkteam.de>  Fri, 31 Dec 2010 01:13:00 +0100
 
 pyhoca-cli (0.1.3-0~nwt1) lucid maverick testing unstable; urgency=low
 
-  * minor fix for new Python X2go version
+  * minor fix for new Python X2Go version
 
  -- Mike Gabriel <m.gabriel at das-netzwerkteam.de>  Fri, 31 Dec 2010 00:28:00 +0100
 
@@ -101,13 +114,13 @@ pyhoca-cli (0.1.2-0~nwt2) lucid maverick testing unstable; urgency=low
 pyhoca-cli (0.1.2-0~nwt1) lucid maverick testing unstable; urgency=low
 
   * disabled use_cache for X2goClient instance
-  * depending on Python X2go 0.0.22
+  * depending on Python X2Go 0.0.22
 
  -- Mike Gabriel <m.gabriel at das-netzwerkteam.de>  Fri, 10 Dec 2010 13:45:00 +0100
 
 pyhoca-cli (0.1.1-0~nwt1) lucid maverick testing unstable; urgency=low
 
-  * adapted to run with Python X2go v0.0.21
+  * adapted to run with Python X2Go v0.0.21
 
  -- Mike Gabriel <m.gabriel at das-netzwerkteam.de>  Thu, 09 Dec 2010 23:30:00 +0100
 
@@ -126,7 +139,7 @@ pyhoca-cli (0.0.15-0~nwt1) lucid maverick testing unstable; urgency=low
 
 pyhoca-cli (0.0.14-0~nwt2) lucid maverick testing unstable; urgency=low
 
-  * depending on bugfix Python X2go version 0.0.12 (or higher)
+  * depending on bugfix Python X2Go version 0.0.12 (or higher)
 
  -- Mike Gabriel <m.gabriel at das-netzwerkteam.de>  Wed, 13 Oct 2010 14:12:00 +0200
 
diff --git a/debian/control b/debian/control
index 32c4033..96d3166 100644
--- a/debian/control
+++ b/debian/control
@@ -20,11 +20,12 @@ Architecture: all
 Depends: 
  ${misc:Depends},
  python,
- python-x2go (>=0.1.1.2-0~),
+ python-x2go (>=0.2.0.2-0~),
  python-argparse,
- python-setproctitle
-Description: A command line X2go client written in Python
- X2go is a server based computing environment with
+ python-setproctitle,
+ python-support (>=0.90)
+Description: Command line X2Go client written in Python
+ X2Go is a server based computing environment with
     - session resuming
     - low bandwith support
     - LDAP support
@@ -33,5 +34,5 @@ Description: A command line X2go client written in Python
     - authentication by smartcard and USB stick
  .
  PyHoca-CLI provides a simple and flexible command line client
- written in Python that allows you to control X2go client sessions
+ written in Python that allows you to control X2Go client sessions
  on desktops and thin clients.
diff --git a/debian/copyright b/debian/copyright
index fc67fec..9e0534c 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,13 +1,29 @@
-pyhoca-cli - Copyright (C) 2010 by Mike Gabriel <m.gabriel at das-netzwerkteam.de>
+pyhoca-cli - Copyright (C) 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 
-Published under the terms of the GNU General Public License.
-See http://www.gnu.org/licenses/gpl.html for a recent copy.
+PyHoca-CLI is free software; you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
 
-On Debian/Ubuntu systems a local copy of the GPL license can also be 
-found in /usr/share/common-licenses.
+PyHoca-CLI is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
 
-The code has been packaged for Debian/Ubuntu by Mike Gabriel 
-<m.gabriel at das-netzwerkteam.de>
+You should have received a copy of the GNU Affero General Public License
+along with this program; if not, write to the
+Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+Published under the terms of the GNU Affero General Public License.
+See http://www.gnu.org/licenses/agpl-3.0.txt for a recent copy.
+
+The code has been packaged for Debian by Mike Gabriel
+<mike.gabriel at das-netzwerkteam.de>
+
+For the contained packaging files for Debian/Ubuntu, however, the
+,,normal'' GNU General Public License (version 3 or higher) applies. 
+A copy of this license can also be found at /usr/share/common-licenses/.
 
 light+love,
 Mike Gabriel
diff --git a/debian/rules b/debian/rules
index f4ddccc..0c53906 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
 # debian/rules file - for pyhoca-cli
 # Based on sample debian/rules file - for GNU Hello (1.3).
-# Copyright 2010 by Mike Gabriel
+# Copyright 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 
 PYVERS=$(shell pyversions -vr)
 
diff --git a/man/man1/pyhoca-cli.1 b/man/man1/pyhoca-cli.1
index b16cbee..9590cbe 100644
--- a/man/man1/pyhoca-cli.1
+++ b/man/man1/pyhoca-cli.1
@@ -5,9 +5,9 @@
 \\$2 \(la\\$1\(ra\\$3
 ..
 .if \n(.g .mso www.tmac
-.TH pyhoca-cli 1 "26 May 2011" "Version 0.1.3.x" "X2go Application"
+.TH pyhoca-cli 1 "Apr 2012" "Version 0.1.4.x" "X2Go Application"
 .SH NAME
-pyhoca-cli \- X2go command line client written in Python
+pyhoca-cli \- X2Go command line client written in Python
 .SH SYNOPSIS
 'nh
 .fi
@@ -22,11 +22,11 @@ pyhoca-cli \- X2go command line client written in Python
 .ad b
 'hy
 .SH DESCRIPTION
-\fBpyhoca-cli\fR aims to be a cross-platform (Windows, Mac OS X, Linux) X2go command line client written 
+\fBpyhoca-cli\fR aims to be a cross-platform (Windows, Mac OS X, Linux) X2Go command line client written 
 in Python.
 .PP
 You can use it 
-for scripting remote X2go sessions or simply starting, resuming or shadowing X2go sessions from
+for scripting remote X2Go sessions or simply starting, resuming or shadowing X2Go sessions from
 the command line in a terminal. 
 .PP
 It supports versatile
@@ -50,17 +50,17 @@ No output to stdout at all!
 Enable debugging output.
 .TP 
 \*(T<\fB\-\-libdebug\fR\*(T> 
-Enable debugging code of the unterlying Python X2go module.
+Enable debugging code of the unterlying Python X2Go module.
 .TP 
 \*(T<\fB\-\-libdebug-sftpxfer\fR\*(T> 
 Enable debugging code of Python X2go's sFTP server code (very verbose, and it may even reveal promiscuous data).
 .SH SERVER / SESSION PROFILE
 You either have to specify a server name or a pre-configured X2goClient session profile to tell \fBpyhoca-cli\fR to
-what X2go server to connect. \fBpyhoca-cli\fR will not start
+what X2Go server to connect. \fBpyhoca-cli\fR will not start
 if neither of these two options has been given on the command line.
 .TP
 \*(T<\fB\-\-server\fR \fI<HOSTNAME_or_IP>\fR\*(T> 
-If not in LDAP mode you always have to name the remote X2go server's hostname or IP address.
+If not in LDAP mode you always have to name the remote X2Go server's hostname or IP address.
 .TP 
 \*(T<\fB\-P, \-\-session-profile\fR \fI<SESSION_PROFILE_NAME>\fR\*(T>
 The name of the session profile to be used to make the connection.
@@ -68,30 +68,30 @@ The name of the session profile to be used to make the connection.
 \fBpyhoca-cli\fR accepts exclusively one of the listed actions:
 .TP
 \*(T<\fB\-N, \-\-new\fR\*(T> 
-Start a new X2go session on server (default mode if no mode is explicitly specified).
+Start a new X2Go session on server (default mode if no mode is explicitly specified).
 .TP 
 \*(T<\fB\-R, \-\-resume\fR \fI<SESSION_NAME>\fR\*(T> 
-Resume existing X2go session <SESSION_NAME> on server. Special values for <SESSION_NAME> are ,,NEWEST'' (will resume youngest session)
+Resume existing X2Go session <SESSION_NAME> on server. Special values for <SESSION_NAME> are ,,NEWEST'' (will resume youngest session)
 or ,,OLDEST'' (resume session with oldest timestamp).
 .TP 
 \*(T<\fB\-D, \-\-share-desktop\fR \fI<USER>@<DISPLAY>\fR\*(T>
-Share an X2go session on the remote server specified by <USER>@<DISPLAY>,
+Share an X2Go session on the remote server specified by <USER>@<DISPLAY>,
 whereas <USER> can be the same user that is starting the share mode session or any
-other user that grants X2go desktop sharing for the current user.
+other user that grants X2Go desktop sharing for the current user.
 .TP 
 \*(T<\fB\-S, \-\-suspend\fR \fI<SESSION_NAME>\fR\*(T> 
-Suspend running X2go session <SESSION_NAME>. A special value for <SESSION_NAME> is ,,ALL'' (will suspend all sessions of the connected user).
+Suspend running X2Go session <SESSION_NAME>. A special value for <SESSION_NAME> is ,,ALL'' (will suspend all sessions of the connected user).
 .TP 
 \*(T<\fB\-T, \-\-terminate\fR \fI<SESSION_NAME>\fR\*(T> 
-Terminate running X2go session <SESSION_NAME>. A special value for <SESSION_NAME> is ,,ALL'' (will terminate all sessions of the connected user).
+Terminate running X2Go session <SESSION_NAME>. A special value for <SESSION_NAME> is ,,ALL'' (will terminate all sessions of the connected user).
 .TP 
 \*(T<\fB\-L, \-\-list-sessions\fR\*(T> 
-List user's X2go sessions on server.
+List user's X2Go sessions on server.
 .SH ACTION OPTIONS
 \fBpyhoca-cli\fR actions can be tweaked by these options:
 .TP
 \*(T<\fB\-\-clean-sessions\fR\*(T> 
-Clean all of the user's suspended/running sessions before starting a new one on the named X2go server.
+Clean all of the user's suspended/running sessions before starting a new one on the named X2Go server.
 .TP
 \*(T<\fB\-\-terminate-on-ctrl-c\fR\*(T> 
 Terminate the connected session when pressing CTRL+C (instead of suspending the session).
@@ -109,7 +109,7 @@ authentication. The cleartext password that has been specified at the command li
 the systems process list (Linux, MacOS). On Windows systems the usage of the --password option is forbidden.
 .TP 
 \*(T<\fB\-p, \-\-remote-ssh-port\fR \fI<R_PORT>\fR\*(T> 
-Remote X2go server's SSH port (default: 22).
+Remote X2Go server's SSH port (default: 22).
 .TP 
 \*(T<\fB\-k, \-\-ssh-privkey\fR \fI<SSH_PRIVKEY>\fR\*(T> 
 Use file <SSH_PRIVKEY> as private key for SSH connections (default: ~/.ssh/id_rsa).
@@ -118,16 +118,16 @@ Use file <SSH_PRIVKEY> as private key for SSH connections (default: ~/.ssh/id_rs
 Add RSA/DSA host key to ~/.ssh/known_hosts if authenticity of server can't be established (default: not set).
 .TP 
 \*(T<\fB\-\-sound\fR \fI{pulse|esd|none}\fR\*(T> 
-X2go server's sound system (default: 'pulse').
+X2Go server's sound system (default: 'pulse').
 .TP 
 \*(T<\fB\-F, \-\-share-local-folders\fR \fI<folder1>[,<folder2>[,...]]\fR\*(T> 
-A comma separated list of local folders that shall be made available in the remote X2go session.
+A comma separated list of local folders that shall be made available in the remote X2Go session.
 .TP 
 \*(T<\fB\-\-printing\fR\*(T> 
-Use X2go printing (default: disabled).
+Use X2Go printing (default: disabled).
 .TP 
 \*(T<\fB\-\-share-mode\fR \fI{0|1}\fR\*(T> 
-Share mode for X2go desktop sharing (0: view-only, 1: full access).
+Share mode for X2Go desktop sharing (0: view-only, 1: full access).
 .TP
 \*(T<\fB\-\-time-to-wait\fR\*(T> 
 Time to wait for session startup/resume (default: 8s). There should be no need to touch this, unless on very slow network connections.
@@ -161,7 +161,7 @@ Use keyboard layout (default: 'us').
 \*(T<\fB\-\-kbd\-type\fR \fI{pc105/us|pc105/de|...}\fR\*(T>
 Set Keyboard type (default 'pc105/us').
 .SH COMPATIBILITY OPTIONS
-\fBpyhoca-cli\fR aims at being fully compatible with all command line options and session config files of the X2go project's X2go command
+\fBpyhoca-cli\fR aims at being fully compatible with all command line options and session config files of the X2Go project's X2Go command
 line client \fBx2goclient-cli\fR as well as the \fBx2goclient\fR GUI. This is still work in progress. 
 To achieve this, some compatibility options have already
 been added:
@@ -196,6 +196,6 @@ rfb-hextile, rfb-tight, rfb-tight-compressed
 .SH "SEE ALSO"
 \fB/usr/share/doc/python-x2go\fR
 .SH AUTHOR
-This manual has been written by for the X2go project (http://www.x2go.org) by
+This manual has been written by for the X2Go project (http://www.x2go.org) by
 
 Mike Gabriel <mike.gabriel at das-netzwerkteam.de> 
diff --git a/pyhoca-cli b/pyhoca-cli
index c6752d9..fcd02fb 100755
--- a/pyhoca-cli
+++ b/pyhoca-cli
@@ -1,19 +1,19 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2010 by Mike Gabriel <m.gabriel at das-netzwerkteam.de>
+# Copyright (C) 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 #
 # PyHoca CLI is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Affero General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # PyHoca CLI is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program; if not, write to the
 # Free Software Foundation, Inc.,
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -30,13 +30,50 @@ import x2go
 
 import sys
 import os
+
+import sys
+import os
+
+PROG_NAME = os.path.basename(sys.argv[0]).replace('.exe', '')
+PROG_PID  = os.getpid()
+
+if hasattr(sys, 'frozen') and sys.frozen in ("windows_exe", "console_exe"):
+    class Win32_Logging(object):
+
+        softspace = 0
+        _fname = os.path.join(os.environ['AppData'], PROG_NAME, '%s.log' % PROG_NAME)
+        _file = None
+
+        def __init__(self, filemode='a'):
+            self._filemode = filemode
+
+        def write(self, text, **kwargs):
+            if self._file is None:
+                try:
+                    try:
+                        os.mkdir(os.path.dirname(self._fname))
+                    except:
+                        pass
+                    self._file = open(self._fname, self._filemode)
+                except:
+                    pass
+            else:
+                self._file.write(text)
+                self._file.flush()
+
+        def flush(self):
+            if self._file is not None:
+                self._file.flush()
+
+    sys.stdout = Win32_Logging(filemode='w+')
+    sys.stderr = Win32_Logging(filemode='a')
+    del Win32_Logging
+
 app = sys.argv[0]
 if app.startswith('./'):
     sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
     os.environ['PYTHONX2GO_LOCAL'] = '1'
 
-PROG_NAME = os.path.basename(sys.argv[0])
-PROG_PID  = os.getpid()
 PROG_OPTIONS = sys.argv[1:]
 try:
     _password_index = PROG_OPTIONS.index('--password')+1
@@ -57,7 +94,7 @@ import getpass
 import paramiko
 from types import *
 
-# Python X2go provides the current local username (OS independent)
+# Python X2Go provides the current local username (OS independent)
 from x2go.defaults import CURRENT_LOCAL_USER as current_user
 
 from x2go.defaults import X2GO_PRINT_ACTIONS
@@ -71,7 +108,7 @@ from pyhoca.cli import current_home, PyHocaCLI, runtime_error
 from pyhoca.cli import __VERSION__ as _version
 VERSION=_version
 VERSION_TEXT="""
-%s[%s] - an X2go command line client written in Python
+%s[%s] - an X2Go command line client written in Python
 ----------------------------------------------------------------------
 developed by Mike Gabriel <m.gabriel at das-netzwerkteam.de>
 
@@ -90,21 +127,21 @@ liblogger = x2go.X2goLogger()
 
 # exclusive client control options
 action_options =   [ 
-                   {'args':['-N','--new'], 'default': False, 'action': 'store_true', 'help': 'start a new X2go session on server (default)', },
-                   {'args':['-R','--resume'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'resume a suspended X2go session with name SESSION_NAME', },
-                   {'args':['-D','--share-desktop'], 'default': None, 'metavar': 'USER at DISPLAY', 'help': 'share an X2go session on server specified by USER at DISPLAY', },
-                   {'args':['-S','--suspend'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'suspend running X2go session SESSION_NAME', },
-                   {'args':['-T','--terminate'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'terminate running X2go session SESSION_NAME', },
-                   {'args':['-L','--list-sessions'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2go sessions on server', },
-                   {'args':['--list-desktops'], 'default': False, 'action': 'store_true', 'help': 'list X2go desktop sessions that are available for sharing', },
-                   {'args':['-l','--list-profiles'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2go pre-configured session profiles', },
+                   {'args':['-N','--new'], 'default': False, 'action': 'store_true', 'help': 'start a new X2Go session on server (default)', },
+                   {'args':['-R','--resume'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'resume a suspended X2Go session with name SESSION_NAME', },
+                   {'args':['-D','--share-desktop'], 'default': None, 'metavar': 'USER at DISPLAY', 'help': 'share an X2Go session on server specified by USER at DISPLAY', },
+                   {'args':['-S','--suspend'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'suspend running X2Go session SESSION_NAME', },
+                   {'args':['-T','--terminate'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'terminate running X2Go session SESSION_NAME', },
+                   {'args':['-L','--list-sessions'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2Go sessions on server', },
+                   {'args':['--list-desktops'], 'default': False, 'action': 'store_true', 'help': 'list X2Go desktop sessions that are available for sharing', },
+                   {'args':['-l','--list-profiles'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2Go pre-configured session profiles', },
                    {'args':['-P','--session-profile'], 'default': None, 'help': 'load x2goclient session profiles and use the session profile SESSION_PROFILE', },
                  ]
 # debug options...
 debug_options =  [ 
                    {'args':['-d','--debug'], 'default': False, 'action': 'store_true', 'help': 'enable application debugging code', },
                    {'args':['--quiet'], 'default': False, 'action': 'store_true', 'help': 'disable any kind of log output', },
-                   {'args':['--libdebug'], 'default': False, 'action': 'store_true', 'help': 'enable debugging code of the underlying Python X2go module', },
+                   {'args':['--libdebug'], 'default': False, 'action': 'store_true', 'help': 'enable debugging code of the underlying Python X2Go module', },
                    {'args':['--libdebug-sftpxfer'], 'default': False, 'action': 'store_true', 'help': 'enable debugging code of Python X2go\'s sFTP server code (very verbose, and even promiscuous)', },
                    {'args':['-V', '--version'], 'default': False, 'action': 'store_true', 'help': 'print version number and exit', },
                  ]
@@ -117,20 +154,20 @@ x2go_options =   [
                    {'args':['-p','--remote-ssh-port'], 'default': '22', 'help': 'remote SSH port (default: 22)', },
                    {'args':['-k','--ssh-privkey'], 'default': None, 'help': 'use file \'SSH_PRIVKEY\' as private key for the SSH connection (e.g. ~/.ssh/id_rsa)', },
                    {'args':['--add-to-known-hosts'], 'default': False, 'action': 'store_true', 'help': 'add RSA host key fingerprint to ~/.ssh/known_hosts if authenticity of server can\'t be established (default: not set)', },
-                   {'args':['--sound'], 'default': 'pulse', 'choices': ('pulse', 'esd', 'none'), 'help': 'X2go server sound system (default: \'pulse\')', },
-                   {'args':['--printing'], 'default': False, 'action': 'store_true', 'help': 'use X2go printing (default: disabled)', },
-                   {'args':['--share-mode'], 'default': 0, 'help': 'share mode for X2go desktop sharing (0: view-only, 1: full access)', },
-                   {'args':['-F', '--share-local-folders'], 'metavar': '<folder1>[,<folder2[,...]]', 'default': None, 'help': 'a comma separated list of local folder names to mount in the X2go session', },
+                   {'args':['--sound'], 'default': 'pulse', 'choices': ('pulse', 'esd', 'none'), 'help': 'X2Go server sound system (default: \'pulse\')', },
+                   {'args':['--printing'], 'default': False, 'action': 'store_true', 'help': 'use X2Go printing (default: disabled)', },
+                   {'args':['--share-mode'], 'default': 0, 'help': 'share mode for X2Go desktop sharing (0: view-only, 1: full access)', },
+                   {'args':['-F', '--share-local-folders'], 'metavar': '<folder1>[,<folder2[,...]]', 'default': None, 'help': 'a comma separated list of local folder names to mount in the X2Go session', },
                    {'args':['--clean-sessions'], 'default': False, 'action': 'store_true', 'help': 'clean all suspended sessions before starting a new one', },
                    {'args':['--terminate-on-ctrl-c'], 'default': False, 'action': 'store_true', 'help': 'terminate the connected session when pressing CTRL+C (instead of suspending the session)', },
                    {'args':['--time-to-wait'], 'default': '8', 'help': 'time to wait for session startup/resume (default: 8s)', },
                    {'args':['--auth-attempts'], 'default': 3, 'help': 'number of authentication attempts before authentication fails (default: 3)', },
                  ]
 print_options =  [ 
-                   {'args':['--print-action'], 'default': 'PDFVIEW', 'choices': PRINT_ACTIONS, 'help': 'action to be performed for incoming X2go print jobs (default: \'PDFVIEW\')', },
-                   {'args':['--pdfview-cmd'], 'default': None, 'help': 'PDF viewer command for displaying incoming X2go print jobs (default: \'%s\'); this option selects \'--print-action PDFVIEW\'' % DEFAULT_PDFVIEW_CMD,},
+                   {'args':['--print-action'], 'default': 'PDFVIEW', 'choices': PRINT_ACTIONS, 'help': 'action to be performed for incoming X2Go print jobs (default: \'PDFVIEW\')', },
+                   {'args':['--pdfview-cmd'], 'default': None, 'help': 'PDF viewer command for displaying incoming X2Go print jobs (default: \'%s\'); this option selects \'--print-action PDFVIEW\'' % DEFAULT_PDFVIEW_CMD,},
                    {'args':['--save-to-folder'], 'default': None, 'metavar': 'PRINT_DEST', 'help': 'save print jobs as PDF files to folder PRINT_DEST (default: \'%s\'); this option selects \'--print-action PDFSAVE\'' % DEFAULT_PDFSAVE_LOCATION,},
-                   {'args':['--printer'], 'default': None, 'help': 'target CUPS print queue for incoming X2go print jobs (default: CUPS default printer); this option selects \'--print-action CUPS\'',},
+                   {'args':['--printer'], 'default': None, 'help': 'target CUPS print queue for incoming X2Go print jobs (default: CUPS default printer); this option selects \'--print-action CUPS\'',},
                    {'args':['--print-cmd'], 'default': None, 'help': 'print command including cmd line arguments (default: \'%s\'); this option selects \'--print-action PRINTCMD\'' % DEFAULT_PRINTCMD_CMD,},
                  ]
 nx_options =     [ 
@@ -145,7 +182,7 @@ compat_options = [
                    {'args':['--port'], 'default': None, 'help': 'compatibility option, synonymous to --remote-ssh-port PORT', },
                    {'args':['--ssh-key'], 'default': None, 'help': 'compatibility option, synonymous to --ssh-privkey SSH_KEY', },
                    {'args':['--use-sound'], 'default': None, 'choices': ('yes', 'no'), 'help': 'compatibility option, synonymous to --sound {pulse|none}', },
-                   {'args':['--client-ssh-port'], 'default': None, 'help': 'compatibility option for the x2goclient GUI; as Python X2go brings its own internal SFTP server, this option will be ignored', },
+                   {'args':['--client-ssh-port'], 'default': None, 'help': 'compatibility option for the x2goclient GUI; as Python X2Go brings its own internal SFTP server, this option will be ignored', },
                  ]
 
 
@@ -165,19 +202,19 @@ def parseargs():
     global logger
     global liblogger
 
-    p = argparse.ArgumentParser(description='X2go command line client implemented in Python.',\
+    p = argparse.ArgumentParser(description='X2Go command line client implemented in Python.',\
                                 epilog="""
 Possible values for the --pack NX option are: 
     %s
 """ % x2go.defaults.pack_methods_nx3_formatted, \
                                 formatter_class=argparse.RawDescriptionHelpFormatter, \
                                 add_help=True, argument_default=None)
-    p_reqargs = p.add_argument_group('X2go server name is always required')
+    p_reqargs = p.add_argument_group('X2Go server name is always required')
     p_reqargs.add_argument('--server', help='server hostname or IP address')
     p_actionopts = p.add_argument_group('client actions')
     p_debugopts = p.add_argument_group('debug options')
-    p_x2goopts = p.add_argument_group('X2go options')
-    p_printopts = p.add_argument_group('X2go print options')
+    p_x2goopts = p.add_argument_group('X2Go options')
+    p_printopts = p.add_argument_group('X2Go print options')
     p_nxopts = p.add_argument_group('NX options')
     p_compatopts = p.add_argument_group('compatibility options')
 
@@ -240,7 +277,7 @@ Possible values for the --pack NX option are:
         if not (a.resume or a.share_desktop or a.suspend or a.terminate or a.list_sessions or a.list_desktops or a.list_profiles):
             a.new = True
 
-    # X2go printing
+    # X2Go printing
     if ((a.pdfview_cmd and a.printer) or
         (a.pdfview_cmd and a.save_to_folder) or
         (a.pdfview_cmd and a.print_cmd) or
@@ -344,7 +381,7 @@ if __name__ == '__main__':
             _session_profiles = x2go.X2goSessionProfiles()
             # retrieve a session list
             print
-            print "Available X2go session profiles"
+            print "Available X2Go session profiles"
             print "==============================="
             print "configuration files: %s" % _session_profiles.config_files
             print "user configuration file: %s" % _session_profiles.user_config_file
@@ -359,8 +396,8 @@ if __name__ == '__main__':
 
         else:
 
-            # initialize the X2GoClient context and start the connection to the X2go server
-            logger('preparing requested X2go session', x2go.loglevel_NOTICE, )
+            # initialize the X2GoClient context and start the connection to the X2Go server
+            logger('preparing requested X2Go session', x2go.loglevel_NOTICE, )
 
             thisPyHocaCLI = PyHocaCLI(args, logger=logger, liblogger=liblogger)
             thisPyHocaCLI.authenticate()
diff --git a/pyhoca/__init__.py b/pyhoca/__init__.py
index 6204815..23f929b 100644
--- a/pyhoca/__init__.py
+++ b/pyhoca/__init__.py
@@ -1,18 +1,18 @@
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2010 by Mike Gabriel <m.gabriel at das-netzwerkteam.de>
+# Copyright (C) 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 #
 # PyHoca CLI is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Affero General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # PyHoca CLI is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program; if not, write to the
 # Free Software Foundation, Inc.,
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/pyhoca/cli/__init__.py b/pyhoca/cli/__init__.py
index 294b0ad..ee5cac6 100644
--- a/pyhoca/cli/__init__.py
+++ b/pyhoca/cli/__init__.py
@@ -1,25 +1,30 @@
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2010 by Dick Kniep <m.gabriel at das-netzwerkteam.de>
+# Copyright (C) 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 #
 # PyHoca CLI is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Affero General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # PyHoca CLI is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program; if not, write to the
 # Free Software Foundation, Inc.,
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 """\
-STILL UNDOCUMENTED
+PyHoca-CLI is a simple command-line tool that allows the launching of
+X2Go sessions.
+
+For further information on X2Go, please visit the X2Go wiki:
+http://wiki.x2go.org
+
 """
-__VERSION__ = "0.1.4.2"
+__VERSION__ = "0.2.0.0"
 
 from frontend import *
diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py
index 363d9e9..b957fae 100644
--- a/pyhoca/cli/frontend.py
+++ b/pyhoca/cli/frontend.py
@@ -1,18 +1,18 @@
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2010 by Mike Gabriel <m.gabriel at das-netzwerkteam.de>
+# Copyright (C) 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 #
 # PyHoca CLI is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Affero General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # PyHoca CLI is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program; if not, write to the
 # Free Software Foundation, Inc.,
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -33,7 +33,7 @@ from gevent import socket
 # for debugging
 import pprint
 
-# a list of available X2go print actions
+# a list of available X2Go print actions
 from x2go.defaults import X2GO_PRINT_ACTIONS
 
 # use current_home as user home dir
@@ -64,7 +64,8 @@ def runtime_error(m, parser=None, exitcode=-1):
 
 class PyHocaCLI(x2go.X2goClient):
     """\
-    STILL UNDOCUMENTED
+    L{PyHocaCLI} is a command-line X2Go Client wrapping around Python X2Go (C{X2goClient} class).
+
     """
     x2go_session_hash = None
 
@@ -75,11 +76,17 @@ class PyHocaCLI(x2go.X2goClient):
 
     def list_sessions(self, s_hash):
         """\
-        STILL UNDOCUMENTED
+        List up server-side available sessions for the logged in user.
+
+        The list of available session is printed to stdout.
+
+        @param s_hash: session UUID
+        @type s_hash: C{str}
+
         """
         # retrieve a session list
         print
-        print "Available runing/suspended X2go sessions"
+        print "Available runing/suspended X2Go sessions"
         print "========================================"
         _peername = self._X2goClient__get_session_server_peername(s_hash)
         print "Host: %s - [%s]:%s" % (self._X2goClient__get_session_server_hostname(s_hash), _peername[0], _peername[1])
@@ -105,16 +112,23 @@ class PyHocaCLI(x2go.X2goClient):
                 print "suspended since: %s" % session_info.date_suspended
                 print
         else:
-            print "No running/suspended sessions found on X2go server."
+            print "No running/suspended sessions found on X2Go server."
             print
 
     def list_desktops(self, s_hash):
         """\
-        STILL UNDOCUMENTED
+        List up server-side available desktop sessions that are
+        available for sharing to the logged in user.
+
+        The list of sharable desktop sessions is printed to stdout.
+
+        @param s_hash: session UUID
+        @type s_hash: C{str}
+
         """
         # retrieve a desktop list
         print
-        print "X2go desktops available for sharing"
+        print "X2Go desktops available for sharing"
         print "==================================="
         _peername = self._X2goClient__get_session_server_peername(s_hash)
         print "Host: %s - [%s]:%s" % (self._X2goClient__get_session_server_hostname(s_hash), _peername[0], _peername[1])
@@ -125,13 +139,19 @@ class PyHocaCLI(x2go.X2goClient):
             for desktop_name in desktop_list:
                 print desktop_name
         else:
-            print "No X2go desktop sessions found that are available for desktop sharing."
+            print "No X2Go desktop sessions found that are available for desktop sharing."
             print
 
     def list_profiles(self):
+        """\
+        List up client-side configured session profile configurations.
+
+        The list of session profiles is printed to stdout.
+
+        """
         # retrieve a session list
         print
-        print "Available X2go session profiles"
+        print "Available X2Go session profiles"
         print "==============================="
         _profiles = self._X2goClient__get_profiles()
         for _profile_id in _profiles.profile_ids:
@@ -143,23 +163,32 @@ class PyHocaCLI(x2go.X2goClient):
 
     def clean_sessions(self, s_hash):
         """\
-        STILL UNDOCUMENTED
+        Clean all running/suspended sessions on the X2Go server that the session with UUID C{s_hash}
+        is connected to.
+
+        @param s_hash: session UUID
+        @type s_hash: C{str}
+
         """
         _profiles = self._X2goClient__get_profiles()
         if self.args.session_profile and _profiles.has_profile(self.args.session_profile):
             _server = _profiles.get_session_param(self.args.session_profile, 'server')
         else:
             _server = self.args.server
-        # clean all sessions from X2go server
-        self.logger('cleaning up all running sessions from X2go server: %s' % _server, loglevel=x2go.loglevel_NOTICE, )
+        # clean all sessions from X2Go server
+        self.logger('cleaning up all running sessions from X2Go server: %s' % _server, loglevel=x2go.loglevel_NOTICE, )
         self._X2goClient__clean_sessions(s_hash)
 
     def new_session(self, s_hash):
         """\
-        STILL UNDOCUMENTED
+        Launch a new X2Go session via the C{X2goSession} object with session UUID C{s_hash}.
+
+        @param s_hash: session UUID
+        @type s_hash: C{str}
+
         """
         # start a new session and run a command
-        self.logger('starting a new X2go session', loglevel=x2go.loglevel_INFO, )
+        self.logger('starting a new X2Go session', loglevel=x2go.loglevel_INFO, )
         if self.args.session_profile is None:
             self.logger('command for new session is: %s' % self.args.command, loglevel=x2go.loglevel_DEBUG, )
         else:
@@ -170,7 +199,7 @@ class PyHocaCLI(x2go.X2goClient):
         session_infos = self._X2goClient__list_sessions(s_hash)
         if session_infos:
             newest_session_name = x2go.utils.session_names_by_timestamp(session_infos)[-1]
-            self._pyhoca_logger("Resuming newest X2go session %s..." % newest_session_name, loglevel=x2go.loglevel_NOTICE, )
+            self._pyhoca_logger("Resuming newest X2Go session %s..." % newest_session_name, loglevel=x2go.loglevel_NOTICE, )
             self._X2goClient__resume_session(s_hash, newest_session_name)
             return True
         return False
@@ -179,17 +208,21 @@ class PyHocaCLI(x2go.X2goClient):
         session_infos = self._X2goClient__list_sessions(s_hash)
         if session_infos:
             oldest_session_name = x2go.utils.session_names_by_timestamp(session_infos)[0]
-            self._pyhoca_logger("Resuming oldest X2go session %s..." % oldest_session_name, loglevel=x2go.loglevel_NOTICE, )
+            self._pyhoca_logger("Resuming oldest X2Go session %s..." % oldest_session_name, loglevel=x2go.loglevel_NOTICE, )
             self._X2goClient__resume_session(s_hash, oldest_session_name)
             return True
         return False
 
     def resume_session(self, s_hash):
         """\
-        STILL UNDOCUMENTED
+        Use C{X2goSession} object with session UUID C{s_hash} to resume a server-side suspended X2Go session.
+
+        @param s_hash: session UUID
+        @type s_hash: C{str}
+
         """
         # resume a running session
-        self.logger('resuming X2go session: %s' % self.args.resume, loglevel=x2go.loglevel_INFO, )
+        self.logger('resuming X2Go session: %s' % self.args.resume, loglevel=x2go.loglevel_INFO, )
         available_sessions = self._X2goClient__list_sessions(s_hash)
         if available_sessions and self.args.resume == 'OLDEST':
             self._auto_resume_oldest(s_hash)
@@ -198,16 +231,20 @@ class PyHocaCLI(x2go.X2goClient):
         elif self.args.resume in available_sessions.keys():
             self._X2goClient__resume_session(s_hash, self.args.resume)
         else:
-            self._runtime_error('requested session not available on X2go server [%s]:%s' % (self.args.server, self.args.remote_ssh_port), exitcode=20)
+            self._runtime_error('requested session not available on X2Go server [%s]:%s' % (self.args.server, self.args.remote_ssh_port), exitcode=20)
 
     def share_desktop_session(self, s_hash):
         """\
-        STILL UNDOCUMENTED
+        Use C{X2goSession} object with session UUID C{s_hash} to share a server-side X2Go desktop session that is available for sharing.
+
+        @param s_hash: session UUID
+        @type s_hash: C{str}
+
         """
         # start a new session and run a command
         _desktop = self.args.share_desktop
         _share_mode = self.args.share_mode
-        self.logger('sharing X2go session: %s' % _desktop, loglevel=x2go.loglevel_INFO, )
+        self.logger('sharing X2Go session: %s' % _desktop, loglevel=x2go.loglevel_INFO, )
         try:
             self._X2goClient__share_desktop_session(s_hash, desktop=_desktop, share_mode=_share_mode)
         except x2go.X2goDesktopSharingException, e:
@@ -216,10 +253,14 @@ class PyHocaCLI(x2go.X2goClient):
 
     def suspend_session(self, s_hash):
         """\
-        STILL UNDOCUMENTED
+        Suspend X2Go Session object with session UUID C{s_hash}.
+
+        @param s_hash: session UUID
+        @type s_hash: C{str}
+
         """
         # send a suspend request to a session
-        self.logger('requesting X2go session suspend of session: %s' % self.args.suspend, loglevel=x2go.loglevel_INFO, )
+        self.logger('requesting X2Go session suspend of session: %s' % self.args.suspend, loglevel=x2go.loglevel_INFO, )
         available_sessions = self._X2goClient__list_sessions(s_hash)
 
         if self.args.suspend == "ALL":
@@ -230,22 +271,25 @@ class PyHocaCLI(x2go.X2goClient):
         for _session_name in _session_names:
             if _session_name in available_sessions.keys():
                 self._X2goClient__suspend_session(s_hash, _session_name)
-                self._pyhoca_logger("X2go session %s has been suspended" % _session_name, loglevel=x2go.loglevel_NOTICE, )
+                self._pyhoca_logger("X2Go session %s has been suspended" % _session_name, loglevel=x2go.loglevel_NOTICE, )
             else:
                 _server = self.args.server
                 _remote_ssh_port = self.args.remote_ssh_port
                 if not self.args.server and self.args.session_profile:
                     _server = self.session_profiles.get_value(self.session_profiles.to_profile_id(self.args.session_profile), 'host')
                     _remote_ssh_port = self.session_profiles.get_value(self.session_profiles.to_profile_id(self.args.session_profile), 'sshport')
-                self._runtime_error('session %s not available on X2go server [%s]:%s' % (_session_name, _server, _remote_ssh_port), exitcode=21)
+                self._runtime_error('session %s not available on X2Go server [%s]:%s' % (_session_name, _server, _remote_ssh_port), exitcode=21)
 
     def terminate_session(self, s_hash):
         """\
-        STILL UNDOCUMENTED
+        Terminate X2Go Session with session UUID C{s_hash}.
+
+        @param s_hash: session UUID
+        @type s_hash: C{str}
 
         """
         # send a terminate request to a session
-        self.logger('requesting X2go session terminate of session: %s' % self.args.terminate, loglevel=x2go.loglevel_INFO, )
+        self.logger('requesting X2Go session terminate of session: %s' % self.args.terminate, loglevel=x2go.loglevel_INFO, )
         available_sessions = self._X2goClient__list_sessions(s_hash)
 
         if self.args.terminate == "ALL":
@@ -256,18 +300,27 @@ class PyHocaCLI(x2go.X2goClient):
         for _session_name in _session_names:
             if _session_name in available_sessions.keys():
                 self._X2goClient__terminate_session(s_hash, _session_name)
-                self._pyhoca_logger("X2go session %s has been terminated" % _session_name, loglevel=x2go.loglevel_NOTICE, )
+                self._pyhoca_logger("X2Go session %s has been terminated" % _session_name, loglevel=x2go.loglevel_NOTICE, )
             else:
                 _server = self.args.server
                 _remote_ssh_port = self.args.remote_ssh_port
                 if not self.args.server and self.args.session_profile:
                     _server = self.session_profiles.get_value(self.session_profiles.to_profile_id(self.args.session_profile), 'host')
                     _remote_ssh_port = self.session_profiles.get_value(self.session_profiles.to_profile_id(self.args.session_profile), 'sshport')
-                self._runtime_error('session %s not available on X2go server [%s]:%s' % (_session_name, _server, _remote_ssh_port), exitcode=22)
+                self._runtime_error('session %s not available on X2Go server [%s]:%s' % (_session_name, _server, _remote_ssh_port), exitcode=22)
 
     def __init__(self, args, logger=None, liblogger=None):
         """\
-        STILL UNDOCUMENTED
+        L{PyHocaCLI} Class constructor.
+
+        @param args: a class with properties representing the command-line options that are available to L{PyHocaCLI} instances.
+        @type args: C{argparse.ArgumentParser} (or similar)
+        @param logger: you can pass an L{X2goLogger} object to the
+            L{PyHocaCLI} constructor for logging application events
+        @type logger: Python X2Go C{X2goLogger} instance
+        @param liblogger: you can pass an L{X2goLogger} object to the
+            L{PyHocaCLI} constructor for logging application events, this object is forwarded to the C{X2goClient} class in Python X2Go 
+        @type liblogger: Python X2Go C{X2goLogger} instance
 
         """
         self.args = args
@@ -277,8 +330,8 @@ class PyHocaCLI(x2go.X2goClient):
             self._pyhoca_logger = copy.deepcopy(logger)
             self._pyhoca_logger.tag = 'PyHocaCLI'
 
-        # initialize the X2goClient context and start the connection to the X2go server
-        self._pyhoca_logger('preparing requested X2go session', loglevel=x2go.loglevel_NOTICE, )
+        # initialize the X2goClient context and start the connection to the X2Go server
+        self._pyhoca_logger('preparing requested X2Go session', loglevel=x2go.loglevel_NOTICE, )
 
         x2go.X2goClient.__init__(self, logger=liblogger)
 
@@ -310,7 +363,7 @@ class PyHocaCLI(x2go.X2goClient):
                         except KeyError:
                             kwargs[a] = v
 
-            # setup up the session profile based X2go session
+            # setup up the session profile based X2Go session
             self.x2go_session_hash = self._X2goClient__register_session(profile_name=self.args.session_profile,
                                                                         known_hosts=ssh_known_hosts_filename,
                                                                         **kwargs
@@ -318,7 +371,7 @@ class PyHocaCLI(x2go.X2goClient):
 
         else:
 
-            # setup up the manually configured X2go session
+            # setup up the manually configured X2Go session
             self.x2go_session_hash = self._X2goClient__register_session(args.server, port=int(self.args.remote_ssh_port), 
                                                            known_hosts=ssh_known_hosts_filename,
                                                            username=self.args.username,
@@ -342,7 +395,8 @@ class PyHocaCLI(x2go.X2goClient):
 
     def authenticate(self):
         """\
-        STILL UNDOCUMENTED
+        Authenticate this L{PyHocaCLI} instance with the remote X2Go server.
+
         """
         connected = False
         force_password_auth = False
@@ -390,7 +444,7 @@ class PyHocaCLI(x2go.X2goClient):
 
     def MainLoop(self):
         """\
-        STILL UNDOCUMENTED
+        Start the main loop of this application.
 
         """
         try:
@@ -398,7 +452,7 @@ class PyHocaCLI(x2go.X2goClient):
             if self.args.clean_sessions:
                 self.clean_sessions(self.x2go_session_hash)
 
-            # go through the possible X2go client modes
+            # go through the possible X2Go client modes
             if self.args.list_sessions:
                 # print a beautified session list for the user
                 self.list_sessions(self.x2go_session_hash)
@@ -433,7 +487,7 @@ class PyHocaCLI(x2go.X2goClient):
                 sys.exit(0)
 
             if self.args.resume or self.args.new:
-                self._pyhoca_logger("give the X2go session some time to come up...", loglevel=x2go.loglevel_NOTICE, )
+                self._pyhoca_logger("give the X2Go session some time to come up...", loglevel=x2go.loglevel_NOTICE, )
 
             i=0
             while i < self.args.time_to_wait:
@@ -444,8 +498,8 @@ class PyHocaCLI(x2go.X2goClient):
 
                 profile_name = self._X2goClient__get_session_profile_name(self.x2go_session_hash)
                 session_name = self._X2goClient__get_session_name(self.x2go_session_hash)
-                self._pyhoca_logger("X2go session is now running, the X2go client's profile name is: %s" % profile_name, loglevel=x2go.loglevel_INFO, )
-                self._pyhoca_logger("X2go session name is: %s" % session_name, loglevel=x2go.loglevel_INFO, )
+                self._pyhoca_logger("X2Go session is now running, the X2Go client's profile name is: %s" % profile_name, loglevel=x2go.loglevel_INFO, )
+                self._pyhoca_logger("X2Go session name is: %s" % session_name, loglevel=x2go.loglevel_INFO, )
                 if self.args.share_desktop:
                     self._pyhoca_logger("Press CTRL+C to end desktop sharing for this session...", loglevel=x2go.loglevel_NOTICE, )
                 elif self.args.terminate_on_ctrl_c:
@@ -466,30 +520,30 @@ class PyHocaCLI(x2go.X2goClient):
                     time.sleep(2)
 
                     if self._X2goClient__has_session_terminated(self.x2go_session_hash):
-                        self._pyhoca_logger("X2go session %s has terminated" % session_name, loglevel=x2go.loglevel_NOTICE, )
+                        self._pyhoca_logger("X2Go session %s has terminated" % session_name, loglevel=x2go.loglevel_NOTICE, )
                     elif self._X2goClient__is_session_suspended(self.x2go_session_hash):
-                        self._pyhoca_logger("X2go session %s has been suspended" % session_name, loglevel=x2go.loglevel_NOTICE, )
+                        self._pyhoca_logger("X2Go session %s has been suspended" % session_name, loglevel=x2go.loglevel_NOTICE, )
                     elif self._X2goClient__is_session_running(self.x2go_session_hash):
-                        self._pyhoca_logger("X2go session %s has been moved to a different screen" % session_name, loglevel=x2go.loglevel_NOTICE, )
+                        self._pyhoca_logger("X2Go session %s has been moved to a different screen" % session_name, loglevel=x2go.loglevel_NOTICE, )
 
                 except KeyboardInterrupt:
                     if self.args.share_desktop:
-                        self._pyhoca_logger("Terminating X2go shared desktop session %s" % session_name, loglevel=x2go.loglevel_INFO, )
+                        self._pyhoca_logger("Terminating X2Go shared desktop session %s" % session_name, loglevel=x2go.loglevel_INFO, )
                         self._X2goClient__terminate_session(self.x2go_session_hash)
                         time.sleep(2)
-                        self._pyhoca_logger("X2go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, )
+                        self._pyhoca_logger("X2Go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, )
                     elif self.args.terminate_on_ctrl_c:
-                        self._pyhoca_logger("Terminating X2go session %s" % session_name, loglevel=x2go.loglevel_INFO, )
+                        self._pyhoca_logger("Terminating X2Go session %s" % session_name, loglevel=x2go.loglevel_INFO, )
                         self._X2goClient__terminate_session(self.x2go_session_hash)
                         # giving nxproxy's SSH tunnel some time to settle
                         time.sleep(2)
-                        self._pyhoca_logger("X2go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, )
+                        self._pyhoca_logger("X2Go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, )
                     else:
-                        self._pyhoca_logger("Suspending X2go session %s" % session_name, loglevel=x2go.loglevel_INFO, )
+                        self._pyhoca_logger("Suspending X2Go session %s" % session_name, loglevel=x2go.loglevel_INFO, )
                         self._X2goClient__suspend_session(self.x2go_session_hash)
                         # giving nxproxy's SSH tunnel some time to settle
                         time.sleep(2)
-                        self._pyhoca_logger("X2go session %s has been suspended" % session_name, loglevel=x2go.loglevel_NOTICE, )
+                        self._pyhoca_logger("X2Go session %s has been suspended" % session_name, loglevel=x2go.loglevel_NOTICE, )
 
         except x2go.X2goSessionException, e:
             self._pyhoca_logger("X2goSessionException occured:", loglevel=x2go.loglevel_ERROR)
diff --git a/setup.py b/setup.py
index e4f18c1..b3f0120 100755
--- a/setup.py
+++ b/setup.py
@@ -1,19 +1,19 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2010 by Mike Gabriel <m.gabriel at das-netzwerkteam.de>
+# Copyright (C) 2010-2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
 # 
 # PyHoca is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Affero General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # PyHoca is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
 # along with this program; if not, write to the
 # Free Software Foundation, Inc.,
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -22,10 +22,10 @@ from setuptools import setup, find_packages
 import pyhoca.cli
 
 setup(
-    name = "PyHoca CLI",
+    name = "PyHoca-CLI",
     version = pyhoca.cli.__VERSION__,
-    description = "PyHoca CLI is a cross-platform (Windows, MacOS X, Linux) X2go client for the command line.",
-    license = 'GPL',
+    description = "PyHoca-CLI is a cross-platform (Windows, MacOS X, Linux) X2Go client for the command line.",
+    license = 'AGPLv3+',
     author = 'Mike Gabriel',
     url = 'http://www.x2go.org',
     packages = [ 'pyhoca.cli', ],


hooks/post-receive
-- 
pyhoca-cli.git (Python X2Go Client (command line client))

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "pyhoca-cli.git" (Python X2Go Client (command line client)).




More information about the x2go-commits mailing list