diff options
| author | Zach DeCook <zachdecook@librem.one> | 2021-04-08 18:37:50 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2021-04-08 18:37:50 -0400 |
| commit | 1c18fc14bffe7ddc93a0585b4960c32b8b98eae4 (patch) | |
| tree | 879c1e24125b383f7dae28d3c805388705cc56d9 /zachwalk.py | |
| parent | f54a46abe735719e75ac3b97efc78a5d5509538d (diff) | |
| download | zachwalk-1c18fc14bffe7ddc93a0585b4960c32b8b98eae4.tar.gz | |
* fix parsing line lines with tabs
Diffstat (limited to 'zachwalk.py')
| -rwxr-xr-x | zachwalk.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/zachwalk.py b/zachwalk.py index b65df8c..145c174 100755 --- a/zachwalk.py +++ b/zachwalk.py @@ -60,6 +60,7 @@ def replaceDateIfNewer(desc, newestdate): def main(): for line in fileinput.input(): #stdin or file from argv if line[0:2] == '=>': + # don't use tabs url = line[2:].strip().split(' ')[0] if isAbsGeminiUrl(url): desc = getdesc(line) @@ -74,7 +75,7 @@ def isAbsGeminiUrl(url): return url[0:9] == 'gemini://' def getdesc(line): - return ' '.join(line[2:].strip().split(' ')[1:]) + return ' '.join(line[2:].strip().replace(' ',' ').split(' ')[1:]).lstrip() if __name__ == '__main__': main() |
