Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianonline committed Apr 23, 2016
2 parents a56805b + a0dc3a9 commit 258d2e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions octoprint_telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,12 @@ def run(self):
continue
# download the file
data = self.main.get_file(msg['document']['file_id'])
self.main._file_manager.add_folder(octoprint.filemanager.FileDestinations.LOCAL, "telegram_uploads", ignore_existing=True)
# self.main._file_manager.add_folder(octoprint.filemanager.FileDestinations.LOCAL, "telegram_uploads", ignore_existing=True)
stream = octoprint.filemanager.util.StreamWrapper(file_name, io.BytesIO(data))
self.main._file_manager.add_file(octoprint.filemanager.FileDestinations.LOCAL, "telegram_uploads/{}".format(file_name), stream, allow_overwrite=True)
self.main.send_msg("I've successfully saved the file you sent me in the folder telegram_uploads.")
# self.main._file_manager.add_file(octoprint.filemanager.FileDestinations.LOCAL, "telegram_uploads/{}".format(file_name), stream, allow_overwrite=True)
target_filename = "telegram_" + file_name
self.main._file_manager.add_file(octoprint.filemanager.FileDestinations.LOCAL, target_filename, stream, allow_overwrite=True)
self.main.send_msg("I've successfully saved the file you sent me as {}.".format(target_filename))
except Exception as ex:
self.main.send_msg("Something went wrong during processing of your file. Sorry. More details are in octoprint.log.")
self._logger.debug("Exception occured during processing of a file: " + traceback.format_exc())
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint-Telegram"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.2.0"
plugin_version = "1.2.1"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 258d2e6

Please sign in to comment.