88# any globally installed versions.
99sys .path .insert (0 , os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
1010from fedex .config import FedexConfig
11+ from fedex .printers .unix import DirectDevicePrinter
1112
13+ # Change these values to match your testing account/meter number.
1214CONFIG_OBJ = FedexConfig (key = 'ZyNQQFdcxUATOx9L' ,
1315 password = '8irpTkULT1zjVLlL8XiVczTex' ,
1416 account_number = '510087780' ,
1517 meter_number = '118501898' ,
16- use_test_server = True )
18+ use_test_server = True )
19+
20+ # Change this to whoever should be the contact person for shipments.
21+ SHIPPER_CONTACT_INFO = {'PersonName' : 'Gregory Taylor' ,
22+ 'CompanyName' : 'International Paper' ,
23+ 'PhoneNumber' : '8646336010' }
24+
25+ # The dictionary below should be your office/client's address that shipping
26+ # will be originating from.
27+ SHIPPER_ADDRESS = {'StreetLines' : ['155 Old Greenville Hwy' , 'Suite 103' ],
28+ 'City' : 'Clemson' ,
29+ 'StateOrProvinceCode' : 'SC' ,
30+ 'PostalCode' : '29631' ,
31+ 'CountryCode' : 'US' ,
32+ 'Residential' : False }
33+
34+ # This contains the configuration for your label printer.
35+ LABEL_SPECIFICATION = {
36+ # Specifies the label type to be returned.
37+ # LABEL_DATA_ONLY or COMMON2D
38+ 'LabelFormatType' : 'COMMON2D' ,
39+ # Specifies which format the label file will be
40+ # sent to you in.
41+ # DPL, EPL2, PDF, PNG, ZPLII
42+ 'ImageType' : 'EPL2' ,
43+ # To use doctab stocks, you must change ImageType above
44+ # to one of the label printer formats (ZPLII, EPL2, DPL).
45+ # See documentation for paper types, there quite a few.
46+ 'LabelStockType' : 'STOCK_4X6.75_LEADING_DOC_TAB' ,
47+ # This indicates if the top or bottom of the label comes
48+ # out of the printer first.
49+ # BOTTOM_EDGE_OF_TEXT_FIRST or TOP_EDGE_OF_TEXT_FIRST
50+ 'LabelPrintingOrientation' : 'BOTTOM_EDGE_OF_TEXT_FIRST'
51+ }
52+
53+ # This should just be a reference to the correct printer class for your
54+ # label printer. You may find these under the fedex.printers module.
55+ # NOTE: This should NOT be an instance. It should just be a reference.
56+ LabelPrinterClass = DirectDevicePrinter
57+
58+ def transfer_config_dict (soap_object , data_dict ):
59+ """
60+ This is a utility function used in the certification modules to transfer
61+ the data dicts above to SOAP objects. This avoids repetition and allows
62+ us to store all of our variable configuration here rather than in
63+ each certification script.
64+ """
65+ for key , val in data_dict .items ():
66+ # Transfer each key to the matching attribute ont he SOAP object.
67+ setattr (soap_object , key , val )
0 commit comments