Skip to content

Commit

Permalink
chg: [pystemon importer] fix gzipped pastes
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jun 22, 2023
1 parent 47e1343 commit f1f33d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/importer/PystemonImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def importer(self):
print(item_id)
if item_id:
print(item_id)
full_item_path = os.path.join(self.dir_pystemon, item_id) # TODO SANITIZE PATH
full_item_path = os.path.join(self.dir_pystemon, item_id) # TODO SANITIZE PATH
# Check if pystemon file exists
if not os.path.isfile(full_item_path):
print(f'Error: {full_item_path}, file not found')
Expand All @@ -47,7 +47,12 @@ def importer(self):
if not content:
return None

return self.create_message(item_id, content, source='pystemon')
if full_item_path[-3:] == '.gz':
gzipped = True
else:
gzipped = False

return self.create_message(item_id, content, gzipped=gzipped, source='pystemon')

except IOError as e:
print(f'Error: {full_item_path}, IOError')
Expand Down

0 comments on commit f1f33d6

Please sign in to comment.