Commit e7602e16 by Raphael Lullis

Getting installation module to work. Updating setup.py

parent 3a7d71e3
...@@ -11,20 +11,11 @@ ...@@ -11,20 +11,11 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import __init__ as parse_rest from connection import API_ROOT
from __init__ import API_ROOT, ParseResource from datatypes import ParseResource
from query import QueryManager from query import QueryManager
class InstallationManager(QueryManager):
def __init__(self):
self._model_class = Installation
def _fetch(self, **kw):
kw['extra_headers'] = {'X-Parse-Master-Key': parse_rest.MASTER_KEY}
response = Installation.GET(Installation.ENDPOINT_ROOT, **kw)
return [Installation(**it) for it in response.get('results')]
class Installation(ParseResource): class Installation(ParseResource):
ENDPOINT_ROOT = '/'.join([API_ROOT, 'installations']) ENDPOINT_ROOT = '/'.join([API_ROOT, 'installations'])
...@@ -42,4 +33,5 @@ class Push(ParseResource): ...@@ -42,4 +33,5 @@ class Push(ParseResource):
targets['where'] = kw targets['where'] = kw
return cls.POST('', data=alert_message, **targets) return cls.POST('', data=alert_message, **targets)
Installation.Query = InstallationManager()
Installation.Query = QueryManager(Installation)
...@@ -3,7 +3,7 @@ from unittest import TextTestRunner, TestLoader ...@@ -3,7 +3,7 @@ from unittest import TextTestRunner, TestLoader
class TestCommand(Command): class TestCommand(Command):
"""Run test suite using 'python setup.py test'""" '''Run test suite using `python setup.py test `'''
user_options = [] user_options = []
def initialize_options(self): def initialize_options(self):
...@@ -13,22 +13,21 @@ class TestCommand(Command): ...@@ -13,22 +13,21 @@ class TestCommand(Command):
pass pass
def run(self): def run(self):
"""Run test suite in parse_rest.tests""" '''Run test suite in parse_rest.tests'''
from parse_rest import tests tests = TestLoader().loadTestsFromNames(['parse_rest.tests'])
tests = TestLoader().loadTestsFromNames(["parse_rest.tests"])
t = TextTestRunner(verbosity=1) t = TextTestRunner(verbosity=1)
t.run(tests) t.run(tests)
setup( setup(
name='parse_rest', name='parse_rest',
version='0.10.2013', version='0.2.20130312',
description='A client library for Parse.com\'.s REST API', description='A client library for Parse.com\'.s REST API',
url='https://github.com/dgrtwo/ParsePy', url='https://github.com/dgrtwo/ParsePy',
packages=['parse_rest'], packages=['parse_rest'],
maintainer="David Robinson", maintainer='David Robinson',
maintainer_email="dgrtwo@princeton.edu", maintainer_email='dgrtwo@princeton.edu',
cmdclass={"test": TestCommand}, cmdclass={'test': TestCommand},
classifiers=[ classifiers=[
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',
'Environment :: Web Environment', 'Environment :: Web Environment',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment