Skip to content

Commit

Permalink
Merge 7d51d5f into 8aab8d3
Browse files Browse the repository at this point in the history
  • Loading branch information
fanglinfang committed Apr 16, 2019
2 parents 8aab8d3 + 7d51d5f commit db5a9a8
Show file tree
Hide file tree
Showing 14 changed files with 1,341 additions and 303 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
sudo: false
language: python
python:
- '2.7'
- '3.6'
before_script:
- pip install -e .
- pip install pycodestyle
- pip install nose2
- pip install coverage
- pip install commonconf
- pip install python-coveralls
- pip install coveralls

script:
- pycodestyle uw_hrp/ --exclude=uw_hrp/tests
- pycodestyle uw_hrp/
- coverage run --source=uw_hrp uw_hrp/test.py -v

after_script:
- coveralls
before_deploy:
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
author_email="aca-it@uw.edu",
include_package_data=True,
install_requires=[
'UW-RestClients-Core>=0.9.6,<1.0',
'UW-RestClients-PWS>=0.6,<1.0',
'UW-RestClients-Core<2.0',
'UW-RestClients-PWS<3.0',
'python-dateutil'
],
license='Apache License, Version 2.0',
description=('A library for connecting to the UW Human Resources API'),
Expand All @@ -34,7 +35,6 @@
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
],
)
15 changes: 11 additions & 4 deletions uw_hrp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@
"""

import logging
import json
from dateutil.parser import parse
from uw_hrp.dao import HRP_DAO
from restclients_core.exceptions import DataFailureException


logger = logging.getLogger(__name__)
hrp_dao = HRP_DAO()


def get_resource(url):
response = HRP_DAO().getURL(url, {'Accept': 'application/json'})
logger.info("%s ==status==> %s" % (url, response.status))
response = hrp_dao.getURL(url, {'Accept': 'application/json'})

logger.debug("{0} ==status==> {1}".format(url, response.status))
if response.status != 200:
raise DataFailureException(url, response.status, response.data)

logger.debug("%s ==data==> %s" % (url, response.data))
logger.debug("{0} ==data==> {1}".format(url, response.data))
return response.data


def parse_date(date_str):
if date_str is not None:
return parse(date_str)
return None
93 changes: 0 additions & 93 deletions uw_hrp/appointee.py

This file was deleted.

0 comments on commit db5a9a8

Please sign in to comment.