diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-05-13 13:21:33 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-14 18:04:10 +0100 |
commit | 80ca4f00f82cd2f58fe5cda38c8cc5a719c887b6 (patch) | |
tree | f2d5a130213c37b8aed1fb07fecf46eb9e5e1a13 /bitbake/lib/toaster/contrib/tts/recv.py | |
parent | 23f5b009e0ebf59cfcc9ae90a1084468fc88e42f (diff) | |
download | poky-80ca4f00f82cd2f58fe5cda38c8cc5a719c887b6.tar.gz |
bitbake: toaster/contrib: adding TTS squashed patch
In order to move the Toaster Test System in Toaster itself,
we create a contrib directory.
The TTS is added as a squashed patch with no history.
It contains code contributed by Ke Zou <ke.zou@windriver.com>.
(Bitbake rev: 7d24fea2b5dcaac6add738b6fb4700d698824286)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/contrib/tts/recv.py')
-rwxr-xr-x | bitbake/lib/toaster/contrib/tts/recv.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/contrib/tts/recv.py b/bitbake/lib/toaster/contrib/tts/recv.py new file mode 100755 index 0000000000..168294acab --- /dev/null +++ b/bitbake/lib/toaster/contrib/tts/recv.py | |||
@@ -0,0 +1,51 @@ | |||
1 | #!/usr/bin/python | ||
2 | |||
3 | # ex:ts=4:sw=4:sts=4:et | ||
4 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
5 | # | ||
6 | # Copyright (C) 2015 Alexandru Damian for Intel Corp. | ||
7 | # | ||
8 | # This program is free software; you can redistribute it and/or modify | ||
9 | # it under the terms of the GNU General Public License version 2 as | ||
10 | # published by the Free Software Foundation. | ||
11 | # | ||
12 | # This program is distributed in the hope that it will be useful, | ||
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | # GNU General Public License for more details. | ||
16 | # | ||
17 | # You should have received a copy of the GNU General Public License along | ||
18 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
20 | |||
21 | # Program to receive review requests by email and log tasks to backlog.txt | ||
22 | # Designed to be run by the email system from a .forward file: | ||
23 | # | ||
24 | # cat .forward | ||
25 | # |[full/path]/recv.py | ||
26 | |||
27 | from __future__ import print_function | ||
28 | import sys, os, config, shellutils | ||
29 | from shellutils import ShellCmdException | ||
30 | |||
31 | from email.parser import Parser | ||
32 | |||
33 | def recv_mail(datastring): | ||
34 | headers = Parser().parsestr(datastring) | ||
35 | return headers['subject'] | ||
36 | |||
37 | |||
38 | if __name__ == "__main__": | ||
39 | lf = shellutils.lockfile(shellutils.mk_lock_filename(), retry = True) | ||
40 | |||
41 | subject = recv_mail(sys.stdin.read()) | ||
42 | |||
43 | subject_parts = subject.split() | ||
44 | if "[review-request]" in subject_parts: | ||
45 | task_name = subject_parts[subject_parts.index("[review-request]") + 1] | ||
46 | with open(os.path.join(os.path.dirname(__file__), config.BACKLOGFILE), "a") as fout: | ||
47 | line = "%s|%s\n" % (task_name, config.TASKS.PENDING) | ||
48 | fout.write(line) | ||
49 | |||
50 | shellutils.unlockfile(lf) | ||
51 | |||