Browse Source

script.utils: fix typo in the doctstring and make documentation and source code clearer

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68362 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 9 years ago
parent
commit
0d62aeaf86
1 changed files with 8 additions and 8 deletions
  1. 8 8
      lib/python/script/utils.py

+ 8 - 8
lib/python/script/utils.py

@@ -150,19 +150,19 @@ class KeyValue(dict):
         self[key] = value
         self[key] = value
 
 
 
 
-def decode(string):
-    """Decode string with defualt locale
+def decode(bytes):
+    """Decode bytes with default locale
 
 
-    :param str string: the string to decode
+    :param bytes bytes: the bytes to decode
     """
     """
     enc = locale.getdefaultlocale()[1]
     enc = locale.getdefaultlocale()[1]
-    if hasattr(string, 'decode'):
-        return string.decode(enc) if enc else string.decode()
-    return string
+    if hasattr(bytes, 'decode'):
+        return bytes.decode(enc) if enc else bytes.decode()
+    return bytes
 
 
 
 
 def encode(string):
 def encode(string):
-    """Encode string with defualt locale
+    """Encode string with default locale -> bytes
 
 
     :param str string: the string to encode
     :param str string: the string to encode
     """
     """
@@ -294,7 +294,7 @@ def get_lib_path(modname, libname=None):
                 modname=modname, libname=libname,
                 modname=modname, libname=libname,
                 pathsep=os.pathsep
                 pathsep=os.pathsep
             )
             )
-    
+
     return path
     return path