Skip to content

Commit 5bb2f88

Browse files
author
Sharoon Thomas
committed
[FIX]Fixed licensing issues all across the module, [IMP]Improved documentation
1 parent 4bb04c0 commit 5bb2f88

File tree

8 files changed

+98
-151
lines changed

8 files changed

+98
-151
lines changed

LICENSE

+22-136
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,8 @@
1-
GNU GENERAL PUBLIC LICENSE
2-
Version 3, 29 June 2007
3-
4-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5-
Everyone is permitted to copy and distribute verbatim copies
6-
of this license document, but changing it is not allowed.
7-
8-
Preamble
9-
10-
The GNU General Public License is a free, copyleft license for
11-
software and other kinds of works.
12-
13-
The licenses for most software and other practical works are designed
14-
to take away your freedom to share and change the works. By contrast,
15-
the GNU General Public License is intended to guarantee your freedom to
16-
share and change all versions of a program--to make sure it remains free
17-
software for all its users. We, the Free Software Foundation, use the
18-
GNU General Public License for most of our software; it applies also to
19-
any other work released this way by its authors. You can apply it to
20-
your programs, too.
21-
22-
When we speak of free software, we are referring to freedom, not
23-
price. Our General Public Licenses are designed to make sure that you
24-
have the freedom to distribute copies of free software (and charge for
25-
them if you wish), that you receive source code or can get it if you
26-
want it, that you can change the software or use pieces of it in new
27-
free programs, and that you know you can do these things.
28-
29-
To protect your rights, we need to prevent others from denying you
30-
these rights or asking you to surrender the rights. Therefore, you have
31-
certain responsibilities if you distribute copies of the software, or if
32-
you modify it: responsibilities to respect the freedom of others.
33-
34-
For example, if you distribute copies of such a program, whether
35-
gratis or for a fee, you must pass on to the recipients the same
36-
freedoms that you received. You must make sure that they, too, receive
37-
or can get the source code. And you must show them these terms so they
38-
know their rights.
39-
40-
Developers that use the GNU GPL protect your rights with two steps:
41-
(1) assert copyright on the software, and (2) offer you this License
42-
giving you legal permission to copy, distribute and/or modify it.
43-
44-
For the developers' and authors' protection, the GPL clearly explains
45-
that there is no warranty for this free software. For both users' and
46-
authors' sake, the GPL requires that modified versions be marked as
47-
changed, so that their problems will not be attributed erroneously to
48-
authors of previous versions.
49-
50-
Some devices are designed to deny users access to install or run
51-
modified versions of the software inside them, although the manufacturer
52-
can do so. This is fundamentally incompatible with the aim of
53-
protecting users' freedom to change the software. The systematic
54-
pattern of such abuse occurs in the area of products for individuals to
55-
use, which is precisely where it is most unacceptable. Therefore, we
56-
have designed this version of the GPL to prohibit the practice for those
57-
products. If such problems arise substantially in other domains, we
58-
stand ready to extend this provision to those domains in future versions
59-
of the GPL, as needed to protect the freedom of users.
60-
61-
Finally, every program is threatened constantly by software patents.
62-
States should not allow patents to restrict development and use of
63-
software on general-purpose computers, but in those that do, we wish to
64-
avoid the special danger that patents applied to a free program could
65-
make it effectively proprietary. To prevent this, the GPL assures that
66-
patents cannot be used to render the program non-free.
67-
68-
The precise terms and conditions for copying, distribution and
69-
modification follow.
70-
71-
TERMS AND CONDITIONS
1+
TERMS AND CONDITIONS
722

733
0. Definitions.
744

75-
"This License" refers to version 3 of the GNU General Public License.
5+
"This License" refers to version 3 of the GNU Affero General Public License.
766

777
"Copyright" also means copyright-like laws that apply to other kinds of
788
works, such as semiconductor masks.
@@ -549,35 +479,45 @@ to collect a royalty for further conveying from those to whom you convey
549479
the Program, the only way you could satisfy both those terms and this
550480
License would be to refrain entirely from conveying the Program.
551481

552-
13. Use with the GNU Affero General Public License.
482+
13. Remote Network Interaction; Use with the GNU General Public License.
483+
484+
Notwithstanding any other provision of this License, if you modify the
485+
Program, your modified version must prominently offer all users
486+
interacting with it remotely through a computer network (if your version
487+
supports such interaction) an opportunity to receive the Corresponding
488+
Source of your version by providing access to the Corresponding Source
489+
from a network server at no charge, through some standard or customary
490+
means of facilitating copying of software. This Corresponding Source
491+
shall include the Corresponding Source for any work covered by version 3
492+
of the GNU General Public License that is incorporated pursuant to the
493+
following paragraph.
553494

554495
Notwithstanding any other provision of this License, you have
555496
permission to link or combine any covered work with a work licensed
556-
under version 3 of the GNU Affero General Public License into a single
497+
under version 3 of the GNU General Public License into a single
557498
combined work, and to convey the resulting work. The terms of this
558499
License will continue to apply to the part which is the covered work,
559-
but the special requirements of the GNU Affero General Public License,
560-
section 13, concerning interaction through a network will apply to the
561-
combination as such.
500+
but the work with which it is combined will remain governed by version
501+
3 of the GNU General Public License.
562502

563503
14. Revised Versions of this License.
564504

565505
The Free Software Foundation may publish revised and/or new versions of
566-
the GNU General Public License from time to time. Such new versions will
567-
be similar in spirit to the present version, but may differ in detail to
506+
the GNU Affero General Public License from time to time. Such new versions
507+
will be similar in spirit to the present version, but may differ in detail to
568508
address new problems or concerns.
569509

570510
Each version is given a distinguishing version number. If the
571-
Program specifies that a certain numbered version of the GNU General
511+
Program specifies that a certain numbered version of the GNU Affero General
572512
Public License "or any later version" applies to it, you have the
573513
option of following the terms and conditions either of that numbered
574514
version or of any later version published by the Free Software
575515
Foundation. If the Program does not specify a version number of the
576-
GNU General Public License, you may choose any version ever published
516+
GNU Affero General Public License, you may choose any version ever published
577517
by the Free Software Foundation.
578518

579519
If the Program specifies that a proxy can decide which future
580-
versions of the GNU General Public License can be used, that proxy's
520+
versions of the GNU Affero General Public License can be used, that proxy's
581521
public statement of acceptance of a version permanently authorizes you
582522
to choose that version for the Program.
583523

@@ -618,57 +558,3 @@ an absolute waiver of all civil liability in connection with the
618558
Program, unless a warranty or assumption of liability accompanies a
619559
copy of the Program in return for a fee.
620560

621-
END OF TERMS AND CONDITIONS
622-
623-
How to Apply These Terms to Your New Programs
624-
625-
If you develop a new program, and you want it to be of the greatest
626-
possible use to the public, the best way to achieve this is to make it
627-
free software which everyone can redistribute and change under these terms.
628-
629-
To do so, attach the following notices to the program. It is safest
630-
to attach them to the start of each source file to most effectively
631-
state the exclusion of warranty; and each file should have at least
632-
the "copyright" line and a pointer to where the full notice is found.
633-
634-
<one line to give the program's name and a brief idea of what it does.>
635-
Copyright (C) <year> <name of author>
636-
637-
This program is free software: you can redistribute it and/or modify
638-
it under the terms of the GNU General Public License as published by
639-
the Free Software Foundation, either version 3 of the License, or
640-
(at your option) any later version.
641-
642-
This program is distributed in the hope that it will be useful,
643-
but WITHOUT ANY WARRANTY; without even the implied warranty of
644-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645-
GNU General Public License for more details.
646-
647-
You should have received a copy of the GNU General Public License
648-
along with this program. If not, see <http://www.gnu.org/licenses/>.
649-
650-
Also add information on how to contact you by electronic and paper mail.
651-
652-
If the program does terminal interaction, make it output a short
653-
notice like this when it starts in an interactive mode:
654-
655-
<program> Copyright (C) <year> <name of author>
656-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657-
This is free software, and you are welcome to redistribute it
658-
under certain conditions; type `show c' for details.
659-
660-
The hypothetical commands `show w' and `show c' should show the appropriate
661-
parts of the General Public License. Of course, your program's commands
662-
might be different; for a GUI interface, you would use an "about box".
663-
664-
You should also get your employer (if you work as a programmer) or school,
665-
if any, to sign a "copyright disclaimer" for the program, if necessary.
666-
For more information on this, and how to apply and follow the GNU GPL, see
667-
<http://www.gnu.org/licenses/>.
668-
669-
The GNU General Public License does not permit incorporating your program
670-
into proprietary programs. If your program is a subroutine library, you
671-
may consider it more useful to permit linking proprietary applications with
672-
the library. If this is what you want to do, use the GNU Lesser General
673-
Public License instead of this License. But first, please read
674-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

magento/__init__.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!/usr/bin/env python
22
# -*- coding: UTF-8 -*-
33
'''
4-
magento
5-
6-
Magento API - SOAP
4+
magento API
75
86
:copyright: (c) 2010 by Sharoon Thomas.
9-
:license: GPLv3, see LICENSE for more details
7+
:copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD
8+
:license: AGPLv3, see LICENSE for more details
109
'''
11-
__version__ = '0.1.0'
10+
__version__ = '0.1.1'
1211

1312
__all__ = [
1413
'API',

magento/api.py

+50-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
Generic API for magento
77
88
:copyright: (c) 2010 by Sharoon Thomas.
9-
:license: GPLv3, see LICENSE for more details
9+
:copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD
10+
:license: AGPLv3, see LICENSE for more details
1011
'''
1112
from xmlrpclib import ServerProxy
1213
from suds.client import Client
@@ -29,6 +30,54 @@ class API(object):
2930
def __init__(self, url, username, password,
3031
version='1.3.2.4', full_url=False, protocol='xmlrpc'):
3132
"""
33+
This is the Base API class which other APIs have to subclass. By
34+
default the inherited classes also get the properties of this
35+
class which will allow the use of the API with the `with` statement
36+
37+
A typical example to extend the API for your subclass is given below::
38+
39+
from magento.api import API
40+
41+
class Core(API):
42+
43+
__slots__ = ( )
44+
45+
def websites(self):
46+
return self.call('ol_websites.list', [])
47+
48+
def stores(self):
49+
return self.call('ol_groups.list', [])
50+
51+
def store_views(self):
52+
return self.call('ol_storeviews.list', [])
53+
54+
The above real life example extends the API for the custom API
55+
implementation for the magento extension
56+
57+
magento-community/Openlabs_OpenERPConnector
58+
59+
Example usage ::
60+
61+
from magento.api import API
62+
63+
with API(url, username, password) as magento_api:
64+
return magento_api.call('customer.list', [])
65+
66+
.. note:: Python with statement has to be imported from __future__
67+
in older versions of python. *from __futur__ import with_statement*
68+
69+
If you want to use the API as a normal class, then you have to manually
70+
end the session. A typical example is below::
71+
72+
from magento.api import API
73+
74+
api = API(url, username, password)
75+
api.connect()
76+
try:
77+
return api.call('customer.list', [])
78+
finally:
79+
api.client.endSession(api.session)
80+
3281
:param url: URL to the magento instance.
3382
By default the URL is treated as a base url
3483
of the domain to which the api part of the URL

magento/catalog.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
Product Catalog API for magento
77
88
:copyright: (c) 2010 by Sharoon Thomas.
9-
:license: GPLv3, see LICENSE for more details
9+
:copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD
10+
:license: AGPLv3, see LICENSE for more details
1011
'''
1112

1213
from magento.api import API

magento/customer.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,23 @@
66
Customer API for magento
77
88
:copyright: (c) 2010 by Sharoon Thomas.
9-
:license: GPLv3, see LICENSE for more details
9+
:copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD.
10+
11+
:license: AGPLv3, see LICENSE for more details
1012
'''
1113

1214
from magento.api import API
1315

1416
class Customer(API):
1517
"""
16-
Customer API to connect to magento
18+
Customer API
19+
20+
Example usage::
21+
22+
from magento import Customer as CustomerAPI
23+
24+
with CustomerAPI(url, username, password) as customer_api:
25+
return customer_api.list()
1726
"""
1827
__slots__ = ( )
1928

magento/directory.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
Directory Country API for magento
77
88
:copyright: (c) 2010 by Sharoon Thomas.
9-
:license: GPLv3, see LICENSE for more details
9+
:copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD
10+
:license: AGPLv3, see LICENSE for more details
1011
'''
1112

1213
from magento.api import API

magento/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
General purpose utility functions
77
88
:copyright: (c) 2010 by Sharoon Thomas.
9-
:license: GPLv3, see LICENSE for more details
9+
:copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD.
10+
:license: AGPLv3, see LICENSE for more details
1011
'''
1112

1213
def expand_url(url, protocol):

setup.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
Magento API
55
66
:copyright: (c) 2010 by Sharoon Thomas.
7-
:license: GPLv3, see LICENSE for more details
7+
:copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD
8+
:license: AGPLv3, see LICENSE for more details
89
910
A simple to use python library to access the magento API and
1011
covered by a complete test suite based on Nose tests. Also
@@ -32,8 +33,8 @@
3233
setup(
3334
name = 'magento',
3435
version=magento.__version__,
35-
url='http://openlabs.co.in/projects/python/magento',
36-
license='GPL',
36+
url='http://projects.openlabs.co.in/trac/openlabs_magento',
37+
license='GNU Affero General Public License v3',
3738
author='Sharoon Thomas, Openlabs Technologies',
3839
author_email='[email protected]',
3940
description='Magento E-Commerce Integration',
@@ -48,7 +49,7 @@
4849
'Development Status :: 4 - Beta',
4950
'Environment :: Web Environment',
5051
'Intended Audience :: Developers',
51-
'License :: OSI Approved :: GPL License',
52+
'License :: OSI Approved :: GNU Affero General Public License v3',
5253
'Operating System :: OS Independent',
5354
'Programming Language :: Python',
5455
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',

0 commit comments

Comments
 (0)