[GRASS-SVN] r62021 - grass/trunk/lib/python/pygrass/messages
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Sep 17 10:52:37 PDT 2014
Author: huhabla
Date: 2014-09-17 10:52:37 -0700 (Wed, 17 Sep 2014)
New Revision: 62021
Modified:
grass/trunk/lib/python/pygrass/messages/__init__.py
Log:
pygrass messages: Better string length libgis restriction handling
Modified: grass/trunk/lib/python/pygrass/messages/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/messages/__init__.py 2014-09-17 17:47:38 UTC (rev 62020)
+++ grass/trunk/lib/python/pygrass/messages/__init__.py 2014-09-17 17:52:37 UTC (rev 62021)
@@ -75,7 +75,11 @@
libgis.G_debug(1, "Stop messenger server")
sys.exit()
- message = data[1]
+ message = data[1]
+ # libgis limitation
+ if isinstance(message, type(" ")):
+ if len(message) >= 2000:
+ message = message[:1999]
if message_type == "PERCENT":
n = int(data[1])
@@ -85,40 +89,19 @@
elif message_type == "DEBUG":
level = data[1]
message = data[2]
- # libgis limitation
- if len(message) >= 2000:
- message = message[:1999]
libgis.G_debug(level, message)
elif message_type == "VERBOSE":
- # libgis limitation
- if len(message) >= 2000:
- message = message[:1999]
libgis.G_verbose_message(message)
elif message_type == "INFO":
- # libgis limitation
- if len(message) >= 2000:
- message = message[:1999]
libgis.G_message(message)
elif message_type == "IMPORTANT":
- # libgis limitation
- if len(message) >= 2000:
- message = message[:1999]
libgis.G_important_message(message)
elif message_type == "WARNING":
- # libgis limitation
- if len(message) >= 2000:
- message = message[:1999]
libgis.G_warning(message)
elif message_type == "ERROR":
- # libgis limitation
- if len(message) >= 2000:
- message = message[:1999]
libgis.G_important_message("ERROR: %s"%message)
# This is for testing only
elif message_type == "FATAL":
- # libgis limitation
- if len(message) >= 2000:
- message = message[:1999]
libgis.G_fatal_error(message)
lock.release()
More information about the grass-commit
mailing list