Skip to content

Commit

Permalink
updates for v2.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
radzhome committed Oct 6, 2016
1 parent 5d9032f commit 6759991
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ Change Log

2.4.0
-----

* Pickup Service usingv11 WSDL (hornedbull)
* TODO: Added examples, documentation and unit tests for Pickup Service.
* Added documentation and unit tests for Pickup Service. (radzhome)
* Update package data to include tools (noodlebreak)

2.3.1
-----
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ include LICENSE.txt
include README.rst
recursive-include examples *.txt *.py
recursive-include docs *
recursive-include fedex/tools *
recursive-include fedex/wsdl *
7 changes: 7 additions & 0 deletions doc_src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
Change Log
==========

2.4.0
-----

* Pickup Service usingv11 WSDL (hornedbull)
* Added documentation and unit tests for Pickup Service. (radzhome)
* Update package data to include tools (noodlebreak)

2.3.0
-----

Expand Down
8 changes: 8 additions & 0 deletions doc_src/services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ Validates the postal codes for a given address.
.. autoclass:: fedex.services.country_service.FedexValidatePostalRequest


Pickup Service
--------------

Creates a fedex pickup request.

.. autoclass:: fedex.services.pickup_service.FedexCreatePickupRequest


Package Movement Service
------------------------

Expand Down
6 changes: 5 additions & 1 deletion epydoc_source/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ using epydoc 3.0.1. The following was used to generate doc:
epydoc -v -o 2.X.X ../fedex/

The epydoc documentation is hosted at https://pythonhosted.org/fedex/.
Latest documentation is now generated using Sphinx.

Latest documentation is now generated using Sphinx. Updates can be made to the
*.rst files in doc_src:
cd python-fedex/doc_src
55 changes: 55 additions & 0 deletions examples/create_pickup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env python
"""
This example shows how to create a pickup request
"""
import datetime

from example_config import CONFIG_OBJ
from fedex.services.pickup_service import FedexCreatePickupRequest

customer_transaction_id = "*** PickupService Request v11 using Python ***" # Optional transaction_id
pickup_service = FedexCreatePickupRequest(CONFIG_OBJ, customer_transaction_id)

pickup_service.OriginDetail.PickupLocation.Contact.PersonName = 'Sender Name'
pickup_service.OriginDetail.PickupLocation.Contact.EMailAddress = '[email protected]'
pickup_service.OriginDetail.PickupLocation.Contact.CompanyName = 'Acme Inc.'
pickup_service.OriginDetail.PickupLocation.Contact.PhoneNumber = '9012638716'
pickup_service.OriginDetail.PickupLocation.Address.StateOrProvinceCode = 'SC'
pickup_service.OriginDetail.PickupLocation.Address.PostalCode = '29631'
pickup_service.OriginDetail.PickupLocation.Address.CountryCode = 'US'
pickup_service.OriginDetail.PickupLocation.Address.StreetLines = ['155 Old Greenville Hwy', 'Suite 103']
pickup_service.OriginDetail.PickupLocation.Address.City = 'Clemson'
# pickup_service.OriginDetail.PickupLocation.Address.UrbanizationCode = '' # For Puerto Rico only
pickup_service.OriginDetail.PickupLocation.Address.Residential = False

# FRONT, NONE, REAR, SIDE
# pickup_service.OriginDetail.PackageLocation = 'NONE'

# APARTMENT, BUILDING, DEPARTMENT, FLOOR, ROOM, SUITE
# pickup_service.OriginDetail.BuildingPart = 'SUITE'

# Identifies the date and time the package will be ready for pickup by FedEx.
pickup_service.OriginDetail.ReadyTimestamp = datetime.datetime.now().replace(microsecond=0).isoformat()

# Identifies the latest time at which the driver can gain access to pick up the package(s)
pickup_service.OriginDetail.CompanyCloseTime = '23:00:00'

pickup_service.CarrierCode = 'FDXE'

pickup_service.TotalWeight.Units = 'LB'
pickup_service.TotalWeight.Value = '1'
pickup_service.PackageCount = '1'
# pickup_service.OversizePackageCount = '1'

# pickup_service.CommodityDescription = ''

# DOMESTIC or INTERNATIONAL
# pickup_service.CountryRelationship = 'DOMESTIC'

# See PickupServiceCategoryType
# pickup_service.PickupServiceCategory = 'FEDEX_DISTANCE_DEFERRED'

pickup_service.send_request()

print pickup_service.response.HighestSeverity == 'SUCCESS'
print pickup_service.response.Notifications[0].Message
2 changes: 1 addition & 1 deletion fedex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
our U{Github project<http://github.com/gtaylor/python-fedex/>} and enter
an issue in the U{Issue Tracker<http://github.com/gtaylor/python-fedex/issues>}.
"""
VERSION = __version__ = '2.3.1'
VERSION = __version__ = '2.4.0'
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'Topic :: Software Development :: Libraries :: Python Modules'
]

KEYWORDS = 'fedex soap suds wrapper rate location ship service'
KEYWORDS = 'fedex soap suds wrapper rate track avs location ship pickup country availability commitment package service'

setup(name='fedex',
version=fedex.VERSION,
Expand All @@ -27,7 +27,7 @@
download_url='http://pypi.python.org/pypi/fedex/',
packages=['fedex', 'fedex.services', 'fedex.printers'],
package_dir={'fedex': 'fedex'},
package_data={'fedex': ['wsdl/*.wsdl', 'wsdl/test_server_wsdl/*.wsdl', 'tools/*.py']},
package_data={'fedex': ['wsdl/*.wsdl', 'wsdl/test_server_wsdl/*.wsdl', 'tools/*']},
platforms=['Platform Independent'],
license='BSD',
classifiers=CLASSIFIERS,
Expand Down
12 changes: 9 additions & 3 deletions tests/test_pickup_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")
class FedexCreatePickupRequestTests(unittest.TestCase):
"""
These tests verify that the rate service WSDL is in good shape.
These tests verify that the pikckup service WSDL is in good shape.
"""

def test_rate(self):
pickup_service = FedexCreatePickupRequest(CONFIG_OBJ)
def setUp(self):
self.config_obj = get_fedex_config()

def tearDown(self):
pass

def test_pickup_request(self):
pickup_service = FedexCreatePickupRequest(self.config_obj)

pickup_service.OriginDetail.PickupLocation.Contact.PersonName = 'Sender Name'
pickup_service.OriginDetail.PickupLocation.Contact.EMailAddress = '[email protected]'
Expand Down

0 comments on commit 6759991

Please sign in to comment.