Skip to content

Commit

Permalink
Minor code clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
egeerardyn committed Apr 10, 2016
1 parent 83f2785 commit 3309d56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 2.0.1

Minor code cleanup.

## Version 2.0.0

Searching is interactive. When you type a query, `texdoc` will automatically
Expand Down
12 changes: 6 additions & 6 deletions texdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def main(wf):

def parseLine(line):
# Line has format "<KEYWORD> <SCORE> <PATH> <DESCRIPTIONS>"
parts = line.split('\t',3)
result = {'keyword': '','score': '', 'file': '', 'description':''}
if len(parts) >= 1: result['keyword'] = parts[0]
if len(parts) >= 2: result['score'] = parts[1]
if len(parts) >= 3: result['file'] = parts[2]
if len(parts) >= 4: result['description'] = parts[3]
values = line.split('\t',3)
fields = ('keyword','score','file','description')
# Build dictionary with values
result = dict((field,'') for field in fields)
for (field,value) in zip(fields, values):
result[field] = value
return result

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.0.1

0 comments on commit 3309d56

Please sign in to comment.