diff options
| author | Dennis Fink | 2020-12-07 22:29:03 +0100 |
|---|---|---|
| committer | Dennis Fink | 2020-12-07 22:29:03 +0100 |
| commit | 98d9e7afc805677d0fae4f0733d2417b8a158517 (patch) | |
| tree | 34fcc04ee0a931a49fa378db90252c110a9d4f52 | |
| parent | 3b8e2b64a15761d55c8d4e837cf7e0ca779cf529 (diff) | |
| download | patternutils-98d9e7afc805677d0fae4f0733d2417b8a158517.tar.gz patternutils-98d9e7afc805677d0fae4f0733d2417b8a158517.zip | |
Fix prss
| -rw-r--r-- | patternutils/commands/prss.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/patternutils/commands/prss.py b/patternutils/commands/prss.py index cc81ee1..95e6a3c 100644 --- a/patternutils/commands/prss.py +++ b/patternutils/commands/prss.py @@ -51,7 +51,7 @@ def prss( "feed_description": parsed_feed.feed.description, } - files = [f for f in walk(directory)] + files = [f.name for f in walk(directory)] matches = [] @@ -68,18 +68,15 @@ def prss( except ValueError: click.secho(f"{file_to_search} not found!", fg="red", err=True) else: - filename = file_to_search[file_index] + filename = files[file_index] entry_values = { "title": entry.title, "link": entry.link, "description": entry.description, "id": entry.id, "enclosure_href": entry.enclosures[0]["href"], - "_path": filename.path, - "_name": filename.name, - "_abspath": os.path.abspath(f.path), - "_realpath": os.path.realpath(f.path), - "_relpath": os.path.relpath(f.path), + "_name": filename, + "_abspath": os.path.abspath(filename), } entry_values.update(default_values) matches.append(entry_values) |
