Skip to content

Commit

Permalink
Merge pull request #26 from seme0021/pre-release-housekeeping
Browse files Browse the repository at this point in the history
Pre-release housekeeping
  • Loading branch information
jonafato authored Mar 29, 2018
2 parents 0267c59 + c9a512c commit 37d8255
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 25 deletions.
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include LICENSE *.md *.rst

# Tests
include tox.ini .coveragerc conftest.py *-requirements.txt
recursive-include tests *.py
exclude .travis.yml
6 changes: 5 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[metadata]
description-file = README.md
description-file = README.md
license-file = LICENSE

[bdist_wheel]
universal = 1
29 changes: 20 additions & 9 deletions zillow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
#!/usr/bin/env python
"""A library that provides a Python interface to the Zillow API."""


"""
A library that provides a Python interface to the Zillow API
"""
from __future__ import absolute_import

import os as _os
import pkg_resources as _pkg_resources

from .error import ZillowError # noqa: F401
from .place import Place # noqa: F401
from .api import ValuationApi # noqa: F401


__author__ = '[email protected]'
__version__ = '0.1'


from .error import ZillowError
from .place import Place
from .api import ValuationApi
try:
_dist = _pkg_resources.get_distribution('python-' + __package__)
if not _os.path.abspath(__file__).startswith(
_os.path.join(_dist.location, __package__)):
# Manually raise the exception if there is a distribution but
# it's installed from elsewhere.
raise _pkg_resources.DistributionNotFound
except _pkg_resources.DistributionNotFound:
__version__ = 'development'
else:
__version__ = _dist.version
18 changes: 8 additions & 10 deletions zillow/api.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
from zillow import (__author__, ZillowError, Place)
import requests
import xmltodict

import requests
try:
# python 3
from urllib.parse import urlparse, urlunparse, urlencode
from urllib.request import urlopen
from urllib.request import __version__ as urllib_version
# python 3
from urllib.parse import urlparse, urlunparse, urlencode
except ImportError:
from urlparse import urlparse, urlunparse
from urllib2 import urlopen
from urllib import urlencode
from urllib import __version__ as urllib_version
from urlparse import urlparse, urlunparse
from urllib import urlencode

from .error import ZillowError
from .place import Place


class ValuationApi(object):
Expand Down
6 changes: 2 additions & 4 deletions zillow/error.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/env python

class ZillowError(Exception):
"""Base class for Twitter errors"""
"""Base class for Zillow errors"""

@property
def message(self):
"""
:return: The first argument used to construct this error.
"""
return self.args[0]
return self.args[0]
2 changes: 1 addition & 1 deletion zillow/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def set_data(self, source_data):
@abstractmethod
def debug(self):
for i in self.__dict__.keys():
print ("%s: %s" % (i, self.__dict__[i]))
print("%s: %s" % (i, self.__dict__[i]))

@abstractmethod
def get_dict(self):
Expand Down

0 comments on commit 37d8255

Please sign in to comment.