summaryrefslogtreecommitdiff
path: root/indra/lib
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2010-12-04 09:14:58 -0500
committerOz Linden <oz@lindenlab.com>2010-12-04 09:14:58 -0500
commitefa42a6aab6d3ada198072c0e2be2b7d9b4e1eb5 (patch)
tree39a949e1570c3524c8560522b693328fc7d9afbf /indra/lib
parenteed7b7201188e01a452c7f4c511c0cb157dc7a5f (diff)
parent7549df0eaf347e9f490f9cfaf4950dd623a08237 (diff)
merge up to viewer-development
Diffstat (limited to 'indra/lib')
-rw-r--r--indra/lib/python/indra/__init__.py2
-rw-r--r--indra/lib/python/indra/util/named_query.py12
-rw-r--r--indra/lib/python/uuid.py10
3 files changed, 9 insertions, 15 deletions
diff --git a/indra/lib/python/indra/__init__.py b/indra/lib/python/indra/__init__.py
index e010741c1c..0c5053cf49 100644
--- a/indra/lib/python/indra/__init__.py
+++ b/indra/lib/python/indra/__init__.py
@@ -4,7 +4,7 @@
$LicenseInfo:firstyear=2006&license=viewerlgpl$
Second Life Viewer Source Code
-Copyright (C) 2010, Linden Research, Inc.
+Copyright (C) 2006-2010, Linden Research, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/indra/lib/python/indra/util/named_query.py b/indra/lib/python/indra/util/named_query.py
index 5c19368240..6bf956107d 100644
--- a/indra/lib/python/indra/util/named_query.py
+++ b/indra/lib/python/indra/util/named_query.py
@@ -36,14 +36,6 @@ import os.path
import re
import time
-#import sys # *TODO: remove. only used in testing.
-#import pprint # *TODO: remove. only used in testing.
-
-try:
- set = set
-except NameError:
- from sets import Set as set
-
from indra.base import llsd
from indra.base import config
@@ -195,8 +187,6 @@ class NamedQuery(object):
style. It also has to look for %:name% and :name% and
ready them for use in LIKE statements"""
if sql:
- #print >>sys.stderr, "sql:",sql
-
# This first sub is to properly escape any % signs that
# are meant to be literally passed through to mysql in the
# query. It leaves any %'s that are used for
@@ -408,7 +398,6 @@ class NamedQuery(object):
# build the query from the options available and the params
base_query = []
base_query.append(self._base_query)
- #print >>sys.stderr, "base_query:",base_query
for opt, extra_where in self._options.items():
if type(extra_where) in (dict, list, tuple):
if opt in params:
@@ -418,7 +407,6 @@ class NamedQuery(object):
base_query.append(extra_where)
if self._query_suffix:
base_query.append(self._query_suffix)
- #print >>sys.stderr, "base_query:",base_query
full_query = '\n'.join(base_query)
# Go through the query and rewrite all of the ones with the
diff --git a/indra/lib/python/uuid.py b/indra/lib/python/uuid.py
index 48dac84377..0bc21a35f8 100644
--- a/indra/lib/python/uuid.py
+++ b/indra/lib/python/uuid.py
@@ -446,8 +446,14 @@ def uuid1(node=None, clock_seq=None):
def uuid3(namespace, name):
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
- import md5
- hash = md5.md5(namespace.bytes + name).digest()
+ try:
+ # Python 2.6
+ from hashlib import md5
+ except ImportError:
+ # Python 2.5 and earlier
+ from md5 import new as md5
+
+ hash = md5(namespace.bytes + name).digest()
return UUID(bytes=hash[:16], version=3)
def uuid4():