-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b7ab51
commit 544f31a
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,11 @@ def main(argv=None): | |
'name', nargs='?', help='the license name to show') | ||
parser_license.set_defaults(func=print_license) | ||
|
||
parser_senditpmail = subparsers.add_parser('senditpmail', help="send itp mail from template") | ||
parser_senditpmail.add_argument( | ||
'file', help='pass file location toend mail from') | ||
parser_senditpmail.set_defaults(func=send_itp) | ||
|
||
if len(argv) == 1: | ||
parser.error("Please specify an option.") | ||
else: | ||
|
@@ -320,5 +325,17 @@ def _show_mapper_warnings(): | |
print("") | ||
|
||
|
||
def send_itp(args): | ||
try: | ||
send_to = '[email protected]' | ||
sub = '\"ITP: ' + (args.file.replace('_itp.mail', ''))[args.file.rfind('node-'):] + ' -- FIX_ME write the Debian package description\"' | ||
file = open(args.file, 'r').read() | ||
mail_body = '\"'+'\n'.join(file.split('\n')[3:])+'\"' | ||
open_mail = 'echo '+str(mail_body)+' | mail -s '+str(sub)+' '+str(send_to) | ||
_os.system(open_mail) | ||
except: | ||
print('ITP file not found!') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |