Commit cbbc1adb authored by Jérome Perrin's avatar Jérome Perrin

XXX proto: update scripts to work with final format

parent 545c6414
...@@ -41,7 +41,7 @@ with open(args.formats, "r") as f: ...@@ -41,7 +41,7 @@ with open(args.formats, "r") as f:
if not (line.startswith("#1") or line.startswith("#2")): if not (line.startswith("#1") or line.startswith("#2")):
print(line) print(line)
continue continue
reference, timespec = line.split(" ", 1) reference, _, timespec = line.split(" ", 2)
parsed_time = dateparser.parse( parsed_time = dateparser.parse(
reference[1:] if reference.startswith("#") else reference, reference[1:] if reference.startswith("#") else reference,
......
...@@ -66,9 +66,9 @@ func main() { ...@@ -66,9 +66,9 @@ func main() {
line := scanner.Text() line := scanner.Text()
// skip comments or empty lines // skip comments or empty lines
if strings.Index(line, "#") != 0 && line != "" { if strings.Index(line, "#") != 0 && line != "" {
parts := strings.SplitN(line, " ", 2) parts := strings.SplitN(line, " ", 3)
reference := parts[0] reference := parts[0]
timespec := parts[1] timespec := parts[2]
preprocessed_timespec := timespec preprocessed_timespec := timespec
if strings.Contains(timespec, "ago") { if strings.Contains(timespec, "ago") {
......
...@@ -49,7 +49,7 @@ with open(args.formats, "r") as f: ...@@ -49,7 +49,7 @@ with open(args.formats, "r") as f:
if not line or line.startswith("#"): if not line or line.startswith("#"):
continue continue
reference, timespec = line.split(" ", 1) reference, _, timespec = line.split(" ", 2)
preprocessed_timespec = timespec preprocessed_timespec = timespec
if "ago" in timespec: if "ago" in timespec:
preprocessed_timespec = timespec.replace(".", " ").replace("_", " ") preprocessed_timespec = timespec.replace(".", " ").replace("_", " ")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment