[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Maposmatic-dev] [PATCH] Cosmetics for debug messages.
From: |
Maxime Petazzoni |
Subject: |
Re: [Maposmatic-dev] [PATCH] Cosmetics for debug messages. |
Date: |
Sun, 29 Nov 2009 13:34:21 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
* David Decotigny <address@hidden> [2009-11-29 13:11:44]:
> Add a few debug messages as normal logging output instead of "print".
Something tells me this is not the commit message related to the patch
below :_)
- Maxime
> ---
> scripts/maposmaticd | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/maposmaticd b/scripts/maposmaticd
> index 299b42f..bb5c365 100755
> --- a/scripts/maposmaticd
> +++ b/scripts/maposmaticd
> @@ -31,7 +31,7 @@ from ocitysmap.coords import BoundingBox as OCMBoundingBox
> from ocitysmap.street_index import OCitySMap
> import Image
>
> -def handler(signum, frame, pipe_write):
> +def sigcld_handler(signum, frame, pipe_write):
> f = os.fdopen(pipe_write, 'w')
> f.write("end")
>
> @@ -61,11 +61,10 @@ def render_job_process(job):
> return 0
>
> def render_job(job):
> - LOG.info("[job %d] starting rendering, title '%s'" % (job.id,
> job.maptitle))
> + LOG.info("[job %d] starting rendering, title '%s'" \
> + % (job.id, job.maptitle))
> job.start_rendering()
> (pipe_read, pipe_write) = os.pipe()
> - signal.signal(signal.SIGCHLD,
> - lambda signal, frame: handler(signal, frame, pipe_write))
> pid = os.fork()
> if pid == 0:
> # Son
> @@ -88,6 +87,11 @@ def render_job(job):
>
> else:
> # Father
> + signal.signal(signal.SIGCHLD,
> + lambda signal, frame: sigcld_handler(signal, frame,
> + pipe_write))
> + LOG.debug("start of process %d" % pid)
> + # Don't close pipe_write here because the sigcld handler depends on it
> child_message = ""
> try:
> (rlist, wlist, xlist) = select.select([pipe_read], [], [], 20*60)
> --
> 1.6.0.4
>
--
Maxime Petazzoni <http://www.bulix.org>
``One by one, the penguins took away my sanity.''
Linux kernel and software developer at MontaVista Software
signature.asc
Description: Digital signature