File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 88
88
# See documentation for paper types, there quite a few.
89
89
shipment .RequestedShipment .LabelSpecification .LabelStockType = 'PAPER_7X4.75'
90
90
91
- # This indicates if the top or bottom of the label comes out of the
92
- # printer first.
93
- # BOTTOM_EDGE_OF_TEXT_FIRST or TOP_EDGE_OF_TEXT_FIRST
94
91
# Timestamp in YYYY-MM-DDThh:mm:ss format, e.g. 2002-05-30T09:00:00
95
92
shipment .RequestedShipment .ShipTimestamp = datetime .datetime .now ().replace (microsecond = 0 ).isoformat ()
96
93
97
- # BOTTOM_EDGE_OF_TEXT_FIRST, TOP_EDGE_OF_TEXT_FIRST
94
+ # This indicates if the top or bottom of the label comes out of the
95
+ # printer first.
96
+ # BOTTOM_EDGE_OF_TEXT_FIRST or TOP_EDGE_OF_TEXT_FIRST
98
97
shipment .RequestedShipment .LabelSpecification .LabelPrintingOrientation = 'TOP_EDGE_OF_TEXT_FIRST'
99
98
100
99
# Delete the flags we don't want.
Original file line number Diff line number Diff line change 66
66
print ("Tracking #: {}" .format (match .TrackingNumber ))
67
67
if hasattr (match , 'TrackingNumberUniqueIdentifier' ):
68
68
print ("Tracking # UniqueID: {}" .format (match .TrackingNumberUniqueIdentifier ))
69
- if hasattr (match , 'StatusDetail.Description' ):
70
- print ("Status Description: {}" .format (match .StatusDetail .Description ))
71
- if hasattr (match , 'StatusDetail.AncillaryDetails' ):
72
- print ("Status AncillaryDetails Reason: {}" .format (match .StatusDetail .AncillaryDetails [- 1 ].Reason ))
73
- print ("Status AncillaryDetails Description: {}"
74
- "" .format (match .StatusDetail .AncillaryDetails [- 1 ].ReasonDescription ))
69
+ if hasattr (match , 'StatusDetail' ):
70
+ if hasattr (getattr (match , 'StatusDetail' ), 'Description' ):
71
+ print ("Status Description: {}" .format (match .StatusDetail .Description ))
72
+ if hasattr (getattr (match , 'StatusDetail' ), 'AncillaryDetails' ):
73
+ print ("Status AncillaryDetails Reason: {}" .format (match .StatusDetail .AncillaryDetails [- 1 ].Reason ))
74
+ print ("Status AncillaryDetails Description: {}"
75
+ "" .format (match .StatusDetail .AncillaryDetails [- 1 ].ReasonDescription ))
75
76
if hasattr (match , 'ServiceCommitMessage' ):
76
77
print ("Commit Message: {}" .format (match .ServiceCommitMessage ))
77
78
if hasattr (match , 'Notification' ):
You can’t perform that action at this time.
0 commit comments