maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Maposmatic-dev] [PATCH 4/4] Read the GIS database lag from a local


From: David MENTRE
Subject: Re: [Maposmatic-dev] [PATCH 4/4] Read the GIS database lag from a local file
Date: Thu, 19 Apr 2012 09:03:00 +0200

Hello Thomas,

2012/4/18 Thomas Petazzoni <address@hidden>:
> +        f = open(www.settings.GIS_DATABASE_LAG_FILE)
> +    except IOError:
>         return None
> -    cursor = db.cursor()
> -    query = "select last_update from maposmatic_admin;"
> +
> +    s = f.readline().strip()

We should call f.close(), shouldn't we? Or, once again, I haven't
understood how Python works. :-)

It might be better to use the "try: ... with" construct as used by Maxime:
  
http://git.savannah.gnu.org/cgit/maposmatic/ocitysmap.git/tree/ocitysmap2/layoutlib/abstract_renderer.py#n108

Best regards,
potential file d.scriptor leak hunter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]