|
18 | 18 |
|
19 | 19 |
|
20 | 20 | # Set this to the INFO level to see the response from Fedex printed in stdout. |
21 | | -#logging.basicConfig(filename="suds.log", level=logging.DEBUG) |
| 21 | +# logging.basicConfig(filename="suds.log", level=logging.DEBUG) |
22 | 22 | logging.basicConfig(level=logging.INFO) |
23 | 23 |
|
24 | 24 | # NOTE: A VALID 'freight_account_number' REQUIRED IN YOUR 'CONFIB_OBJ' FOR THIS SERVICE TO WORK. |
|
60 | 60 |
|
61 | 61 | # This is needed to ensure an accurate rate quote with the response. |
62 | 62 | shipment.RequestedShipment.Recipient.Address.Residential = False |
63 | | -shipment.RequestedShipment.FreightShipmentDetail.TotalHandlingUnits = 1 |
| 63 | +shipment.RequestedShipment.FreightShipmentDetail.TotalHandlingUnits = 1 |
64 | 64 | shipment.RequestedShipment.ShippingChargesPayment.Payor.ResponsibleParty.AccountNumber = \ |
65 | 65 | CONFIG_OBJ.freight_account_number |
66 | 66 |
|
|
124 | 124 | package1.HazardousMaterials = None |
125 | 125 | package1.Pieces = 12 |
126 | 126 |
|
127 | | - |
128 | 127 | shipment.RequestedShipment.FreightShipmentDetail.LineItems = package1 |
129 | 128 |
|
130 | 129 | # If you'd like to see some documentation on the ship service WSDL, un-comment |
131 | 130 | # this line. (Spammy). |
132 | | -#print(shipment.client) |
| 131 | +# print(shipment.client) |
133 | 132 |
|
134 | 133 | # Un-comment this to see your complete, ready-to-send request as it stands |
135 | 134 | # before it is actually sent. This is useful for seeing what values you can |
136 | 135 | # change. |
137 | | -#print(shipment.RequestedShipment) |
| 136 | +# print(shipment.RequestedShipment) |
138 | 137 |
|
139 | 138 | # If you want to make sure that all of your entered details are valid, you |
140 | 139 | # can call this and parse it just like you would via send_request(). If |
141 | 140 | # shipment.response.HighestSeverity == "SUCCESS", your shipment is valid. |
142 | | -#shipment.send_validation_request() |
| 141 | +# shipment.send_validation_request() |
143 | 142 |
|
144 | 143 | # Fires off the request, sets the 'response' attribute on the object. |
145 | 144 | shipment.send_request() |
|
154 | 153 |
|
155 | 154 | # Getting the tracking number from the new shipment. |
156 | 155 | print("Tracking #: {}" |
157 | | - "".format(shipment.response.CompletedShipmentDetail.MasterTrackingId.TrackingNumber)) |
| 156 | + "".format(shipment.response.CompletedShipmentDetail.MasterTrackingId.TrackingNumber)) |
158 | 157 |
|
159 | 158 | # Net shipping costs. |
160 | 159 | amount = shipment.response.CompletedShipmentDetail.ShipmentRating.ShipmentRateDetails[0].TotalNetCharge.Amount |
|
187 | 186 | """ |
188 | 187 | # Pipe the binary directly to the label printer. Works under Linux |
189 | 188 | # without requiring PySerial. This WILL NOT work on other platforms. |
190 | | -#label_printer = open("/dev/ttyS0", "w") |
191 | | -#label_printer.write(label_binary_data) |
192 | | -#label_printer.close() |
| 189 | +# label_printer = open("/dev/ttyS0", "w") |
| 190 | +# label_printer.write(label_binary_data) |
| 191 | +# label_printer.close() |
193 | 192 |
|
194 | 193 | """ |
195 | 194 | This is a potential cross-platform solution using pySerial. This has not been |
196 | 195 | tested in a long time and may or may not work. For Windows, Mac, and other |
197 | 196 | platforms, you may want to go this route. |
198 | 197 | """ |
199 | | -#import serial |
200 | | -#label_printer = serial.Serial(0) |
201 | | -#print("SELECTED SERIAL PORT: "+ label_printer.portstr) |
202 | | -#label_printer.write(label_binary_data) |
203 | | -#label_printer.close() |
| 198 | +# import serial |
| 199 | +# label_printer = serial.Serial(0) |
| 200 | +# print("SELECTED SERIAL PORT: "+ label_printer.portstr) |
| 201 | +# label_printer.write(label_binary_data) |
| 202 | +# label_printer.close() |
0 commit comments