Add autofrom Option to Email Notify Plugin#1966
Merged
liiight merged 16 commits intoFlexget:developfrom Sep 16, 2017
andocromn:develop
Merged
Add autofrom Option to Email Notify Plugin#1966liiight merged 16 commits intoFlexget:developfrom andocromn:develop
liiight merged 16 commits intoFlexget:developfrom
andocromn:develop
Conversation
Adds the option container_directory to the Deluge plugin container_directory is a jinja2 template used by client.core.rename_folder to rename the top level folder - which is effectively the torrent name in deluge added 'name' to status_keys array to support this
added code to check that there is more than 1 file and abort if the torrent is a single file
changed verification from file count greater than 1 to check for a folder structure changed to folder_rename to use name extracted from folder structure instead of torrent name removed 'name' from status_keys - thanks tubedogg for the suggestions and assistance
changed logging to verbose / debug per liiight's suggestion
changed container_directory to variable retrieved from config or set entry - container_directory option did not work if configured by set
per tubedogg's recommendation
rebase my fork
Added the ability to set the from automatically based on the FQDN hostname of the system and user running the process
liiight
reviewed
Sep 15, 2017
flexget/plugins/notifiers/email.py
Outdated
| email['To'] = ','.join(config['to']) | ||
| email['From'] = config['from'] | ||
| if config['autofrom']: | ||
| email['From'] = os.getlogin() + '@' + socket.getfqdn() |
Member
There was a problem hiding this comment.
Weird indentation. Probably used tab instead of spaces
flexget/plugins/notifiers/email.py
Outdated
| if config['autofrom']: | ||
| email['From'] = os.getlogin() + '@' + socket.getfqdn() | ||
| else: | ||
| email['From'] = config['from'] |
removed extra spaces
cvium
reviewed
Sep 15, 2017
flexget/plugins/notifiers/email.py
Outdated
| email['To'] = ','.join(config['to']) | ||
| email['From'] = config['from'] | ||
| if config['autofrom']: | ||
| email['From'] = os.getlogin() + '@' + socket.getfqdn() |
Contributor
There was a problem hiding this comment.
os.getlogin() is not cross-platform for Python 2.7
looks like getpass.getuser() is cross platform I have tested on Windows and Linux, unfortunately I do not have a Mac to test on could add error handling - lmk
Member
|
Have you tested this on windows by any chance? |
Contributor
Author
|
yeah I did test on windows and linux |
Member
|
Cool. Care to update the wiki? |
Contributor
Author
|
wiki updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for changes:
want to have the ability have the email from field automatically generated with the system hostname and username compatible with linux/bsd mta
Detailed changes:
Config usage if relevant (new plugin or updated schema):