silke: thuban/Thuban/UI about.py,1.13,1.14

Bernhard Herzog bh at intevation.de
Wed Aug 11 11:46:47 CEST 2004


cvs at intevation.de writes:

> --- about.py	10 Aug 2004 19:58:50 -0000	1.13
> +++ about.py	11 Aug 2004 08:09:44 -0000	1.14
> @@ -14,8 +14,6 @@
>  
>  from wxPython.wx import *
>  
> -import locale
> -
>  from Thuban import _
>  from Thuban.version import versions
>  from Thuban.Model.resource import gdal_support_status
> @@ -135,6 +133,7 @@
>      " Function to convert a unicode object to an object \ in the user's locale encoding"

What's that backslash doing there?  Also, the line is much too long.
See coding_guidelines.txt for how to format doc-strings.

>  
>  
> -    import locale
> -    return unicodeStr.encode(locale.getlocale()[1])
> +    from locale import getlocale
> +
> +    return unicodeStr.encode(getlocale()[1])

I'm sorry to pick on this too, :), but I'd have preferred to remove the
import from unicodeToLocale and keep the one at the top of the module.
In almost all cases, imports should be done at the top of the module and
not inside functions.  This is also covered by coding_guidelines.txt,
btw.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Skencil                                http://sketch.sourceforge.net/
Thuban                                  http://thuban.intevation.org/




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)