summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/contrib/tts/recv.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-07-30 19:25:09 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-01 11:26:13 +0100
commit1640a65091c56eeed0f6bb1020fd156cdc279a6e (patch)
treeee36a0a10c1fea4d5e10e645b9077f80d6d67567 /bitbake/lib/toaster/contrib/tts/recv.py
parent160d610604fff0b119de2b70a9da8a5f73d93715 (diff)
downloadpoky-1640a65091c56eeed0f6bb1020fd156cdc279a6e.tar.gz
bitbake: toaster: tts: fix pylint warnings
This patch brings TTS to the pylint coding standards. Pylint was run with some disables: disable=logging-too-many-args,line-too-long,missing-docstring and achieved Your code has been rated at 10.00/10 There are no functional changes. (Bitbake rev: 2b40b412ff6a7e3fd4cc32707bd3cd713bc09ddb) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/contrib/tts/recv.py')
-rwxr-xr-xbitbake/lib/toaster/contrib/tts/recv.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/contrib/tts/recv.py b/bitbake/lib/toaster/contrib/tts/recv.py
index 168294acab..2faf8d08c7 100755
--- a/bitbake/lib/toaster/contrib/tts/recv.py
+++ b/bitbake/lib/toaster/contrib/tts/recv.py
@@ -26,7 +26,6 @@
26 26
27from __future__ import print_function 27from __future__ import print_function
28import sys, os, config, shellutils 28import sys, os, config, shellutils
29from shellutils import ShellCmdException
30 29
31from email.parser import Parser 30from email.parser import Parser
32 31
@@ -34,9 +33,13 @@ def recv_mail(datastring):
34 headers = Parser().parsestr(datastring) 33 headers = Parser().parsestr(datastring)
35 return headers['subject'] 34 return headers['subject']
36 35
36def main():
37 lock_file = shellutils.lockfile(shellutils.mk_lock_filename(), retry=True)
37 38
38if __name__ == "__main__": 39 if lock_file is None:
39 lf = shellutils.lockfile(shellutils.mk_lock_filename(), retry = True) 40 if config.DEBUG:
41 print("Concurrent script in progress, exiting")
42 sys.exit(1)
40 43
41 subject = recv_mail(sys.stdin.read()) 44 subject = recv_mail(sys.stdin.read())
42 45
@@ -47,5 +50,7 @@ if __name__ == "__main__":
47 line = "%s|%s\n" % (task_name, config.TASKS.PENDING) 50 line = "%s|%s\n" % (task_name, config.TASKS.PENDING)
48 fout.write(line) 51 fout.write(line)
49 52
50 shellutils.unlockfile(lf) 53 shellutils.unlockfile(lock_file)
51 54
55if __name__ == "__main__":
56 main()