-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Works with python3 #6
Open
joncombe
wants to merge
2
commits into
hudora:master
Choose a base branch
from
joncombe:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
build | ||
dist | ||
html | ||
pyShipping.egg-info | ||
*.egg-info | ||
*.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ class Entladebericht(object): | |
# Gitterbox-Paletten-Entladung Empfangspartner kann 3/0 115 - 117 | ||
# Verkehrsart** kann 1 118 - 118 | ||
# Frei 9 119 - 127 | ||
# Releasestand ���5’ muss 1 128 - 128 | ||
# Releasestand ���5’ muss 1 128 - 128 | ||
|
||
n_record_re = (r'N(?P<borderonr>[0-9 ]{18})(?P<position>[0-9 ]{3})(?P<sendungsnrversender>[0-9 ]{16})' | ||
+ r'(?P<sendungsnrempfaenger>[0-9 ]{16})(?P<differenzschluessel1>..)' | ||
|
@@ -51,11 +51,11 @@ class Entladebericht(object): | |
# Laufende Bordero-Position Versandpartner muss 3/0 020 - 022 | ||
# Sendungs-Nr. Versandpartner muss 16 023 - 038 | ||
# Sendungs-Nr. Empfangspartner muss 16 039 - 054 | ||
# Differenzartschlu�ssel 1* muss 2 055 - 056 | ||
# Differenzartschlu�ssel 1* muss 2 055 - 056 | ||
# Differenzanzahl 1 kann 4/0 057 - 060 | ||
# Verpackungsart 1** kann 2 061 - 062 | ||
# Text/Hinweis 1 kann 29 063 - 091 | ||
# Differenzartschlu�ssel 2* kann 2 092 - 093 | ||
# Differenzartschlu�ssel 2* kann 2 092 - 093 | ||
# Differenzanzahl 2 kann 4/0 094 - 097 | ||
# Verpackungsart 2** kann 2 098 - 099 | ||
# Text/Hinweis 2 kann 29 100 - 128 | ||
|
@@ -66,60 +66,60 @@ class Entladebericht(object): | |
+ r'(?P<date>[0-9 ]{8})(?P<time>[0-9 ]{4})' | ||
+ r'(?P<benutzer>.{10})(?P<terminal>.{4})') | ||
v_record_re = re.compile(v_record_re) | ||
# Lo�st 'N'-Satz ab bei Einsatz von Barcode | ||
# Lo�st 'N'-Satz ab bei Einsatz von Barcode | ||
# Satzart ‘V’ muss 1 001 - 001 | ||
# Bordero-Nr. Versandpartner muss 18 002 - 019 | ||
# Sendungs-Nr. Versandpartner muss 16 020 - 035 | ||
# Barcode-Qualifier * kann 3 036 - 038 | ||
# Barcode-Nr. muss 35 039 - 073 | ||
# Fehler-/Hinweiscode 1 ** muss 3 074 - 076 | ||
# Frei wa�hlbarer Text/Hinweis kann 24 077 - 100 | ||
# Frei wa�hlbarer Text/Hinweis kann 24 077 - 100 | ||
# Ereignisdatum (TTMMJJJJ) muss 8 101 - 108 | ||
# Ereignisuhrzeit (HHMMSS) muss 6 109 - 114 | ||
# Benutzer-ID kann 10 115 - 124 | ||
# Scanner/Terminal-ID kann 4 125 - 128 | ||
# Fehler-/Hinweiscode: | ||
statustexte = { | ||
0: 'Packst�ck', | ||
2: 'Packst�ck eingedr�ckt', | ||
3: 'Packst�ck aufgerissen, Ware greifbar', | ||
4: 'Packst�ck nass', | ||
5: 'Packst�ckinhalt l�uft aus', | ||
9: 'Packst�ck besch�digt', | ||
0: 'Packst�ck', | ||
2: 'Packst�ck eingedr�ckt', | ||
3: 'Packst�ck aufgerissen, Ware greifbar', | ||
4: 'Packst�ck nass', | ||
5: 'Packst�ckinhalt l�uft aus', | ||
9: 'Packst�ck besch�digt', | ||
10: 'Euro-Palette', | ||
11: 'Euro-Palette, Ware besch�digt', | ||
12: 'Euro-Palette besch�digt', | ||
13: 'Euro-Palette und Ware besch�digt', | ||
14: 'Euro-Palette verschwei�t/gewickelt', | ||
11: 'Euro-Palette, Ware besch�digt', | ||
12: 'Euro-Palette besch�digt', | ||
13: 'Euro-Palette und Ware besch�digt', | ||
14: 'Euro-Palette verschwei�t/gewickelt', | ||
15: 'Euro-Palette, Folie ein-/aufgerissen, Ware greifbar', | ||
19: 'Euro-Palette und/oder Ware mit Besch�digung', | ||
19: 'Euro-Palette und/oder Ware mit Besch�digung', | ||
20: 'Gitterbox', | ||
21: 'Gitterbox, Ware besch�digt', | ||
22: 'Gitterbox besch�digt', | ||
23: 'Gitterbox und Ware besch�digt', | ||
29: 'Gitterbox und/oder Ware mit Besch�digung', | ||
21: 'Gitterbox, Ware besch�digt', | ||
22: 'Gitterbox besch�digt', | ||
23: 'Gitterbox und Ware besch�digt', | ||
29: 'Gitterbox und/oder Ware mit Besch�digung', | ||
30: 'Halbpalette', | ||
31: 'Halbpalette, Ware besch�digt', | ||
32: 'Halbpalette besch�digt', | ||
33: 'Halbpalette und Ware besch�digt', | ||
34: 'Halbpalette verschwei�t/gewickelt', | ||
31: 'Halbpalette, Ware besch�digt', | ||
32: 'Halbpalette besch�digt', | ||
33: 'Halbpalette und Ware besch�digt', | ||
34: 'Halbpalette verschwei�t/gewickelt', | ||
35: 'Halbpalette, Folie ein-/aufgerissen, Ware greifbar', | ||
39: 'Halbpalette und/oder Ware mit Besch�digung', | ||
39: 'Halbpalette und/oder Ware mit Besch�digung', | ||
40: 'Einwegpalette', | ||
41: 'Einwegpalette, Ware besch�digt', | ||
42: 'Einwegpalette besch�digt', | ||
43: 'Einwegpalette und Ware besch�digt', | ||
44: 'Einwegpalette verschwei�t/gewickelt', | ||
41: 'Einwegpalette, Ware besch�digt', | ||
42: 'Einwegpalette besch�digt', | ||
43: 'Einwegpalette und Ware besch�digt', | ||
44: 'Einwegpalette verschwei�t/gewickelt', | ||
45: 'Einwegpalette, Folie ein-/aufgerissen, Ware greifbar', | ||
49: 'Einwegpalette und/oder Ware mit Besch�digung.', | ||
50: 'Packst�ck fehlt bei Entladung', # (Wird durch Entladebericht beim EP erzeugt) | ||
49: 'Einwegpalette und/oder Ware mit Besch�digung.', | ||
50: 'Packst�ck fehlt bei Entladung', # (Wird durch Entladebericht beim EP erzeugt) | ||
51: 'Backbox SK1*', | ||
52: 'Backbox SK2*', | ||
53: 'Backbox SK3*', | ||
54: 'Backbox SK4*', | ||
62: 'HUB/Konsolidierungspunkt - Packst�ck handverteilt', | ||
63: 'HUB/Konsolidierungspunkt - Palette mit �berma�', | ||
64: 'HUB/Konsolidierungspunkt - Packstu�ckroutung nicht lesbar (Nachbearbeitung)', | ||
62: 'HUB/Konsolidierungspunkt - Packst�ck handverteilt', | ||
63: 'HUB/Konsolidierungspunkt - Palette mit �berma�', | ||
64: 'HUB/Konsolidierungspunkt - Packstu�ckroutung nicht lesbar (Nachbearbeitung)', | ||
65: 'HUB/Konsolidierungspunkt - Versender Direktanlieferung - Aufkleber erstellt', | ||
66: 'HUB/Konsolidierungspunkt - Dienstleistung - Routung durch HUB / Konsolidierungspunkt', | ||
67: 'HUB/Konsolidierungspunkt - Dienstleistung - Vereinbarte Nachbearbeitung', | ||
|
@@ -131,7 +131,7 @@ class Entladebericht(object): | |
95: 'PLZ-Fehler*', | ||
96: 'Platzmangel', | ||
97: 'Zeitmangel', | ||
98: 'R�ckscannung - Packstu�ck wieder entladen', | ||
98: 'R�ckscannung - Packstu�ck wieder entladen', | ||
99: 'Korrekturscannung', | ||
} | ||
|
||
|
@@ -188,18 +188,18 @@ def parse(self, data): | |
if line[0] == 'M': | ||
match = re.search(Entladebericht.m_record_re, line) | ||
if not match: | ||
print 'no match', repr(line) | ||
print('no match', repr(line)) | ||
# the content of M records are ignored | ||
elif line[0] == 'N': | ||
match = re.search(Entladebericht.n_record_re, line) | ||
if not match: | ||
print 'no match', repr(line) | ||
print('no match', repr(line)) | ||
# the content of N records are ignored | ||
elif line[0] == 'V': | ||
match = re.search(Entladebericht.v_record_re, line) | ||
newdict = {} | ||
if not match: | ||
print 'no match', repr(line) | ||
('no match', repr(line)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you delete this print? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well spotted, I think that one was deleted in eror. |
||
for key, value in match.groupdict().items(): | ||
newdict[key] = value.strip() | ||
newdict['timestamp'] = datetime.datetime(int(newdict['date'][4:]), int(newdict['date'][2:4]), | ||
|
@@ -211,4 +211,4 @@ def parse(self, data): | |
elif line[0] == 'W': | ||
pass # we happyly ignore W records | ||
else: | ||
print "unknown %r" % line | ||
print("unknown %r" % line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have this error when calling the funtion
binpack
below this lineIn my opinion, we should do something like this:
import pyshipping.binpack_simple as binpack_simple