diff options
Diffstat (limited to 'indra/lib/python')
-rw-r--r-- | indra/lib/python/indra/base/cllsd_test.py | 22 | ||||
-rw-r--r-- | indra/lib/python/indra/base/lluuid.py | 6 | ||||
-rw-r--r-- | indra/lib/python/indra/ipc/httputil.py | 21 | ||||
-rw-r--r-- | indra/lib/python/indra/ipc/russ.py | 2 | ||||
-rw-r--r-- | indra/lib/python/indra/ipc/siesta_test.py | 21 | ||||
-rwxr-xr-x | indra/lib/python/indra/util/llperformance.py | 26 | ||||
-rw-r--r-- | indra/lib/python/indra/util/llversion.py | 57 | ||||
-rwxr-xr-x | indra/lib/python/indra/util/simperf_proc_interface.py | 2 | ||||
-rw-r--r-- | indra/lib/python/indra/util/test_win32_manifest.py | 49 | ||||
-rw-r--r-- | indra/lib/python/uuid.py | 21 |
10 files changed, 159 insertions, 68 deletions
diff --git a/indra/lib/python/indra/base/cllsd_test.py b/indra/lib/python/indra/base/cllsd_test.py index 0b20d99d80..1f06898ffd 100644 --- a/indra/lib/python/indra/base/cllsd_test.py +++ b/indra/lib/python/indra/base/cllsd_test.py @@ -1,3 +1,25 @@ +#!/usr/bin/python +## +## $LicenseInfo:firstyear=2011&license=viewerlgpl$ +## Second Life Viewer Source Code +## Copyright (C) 2011, 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 +## License as published by the Free Software Foundation; +## version 2.1 of the License only. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +## $/LicenseInfo$ from indra.base import llsd, lluuid from datetime import datetime import cllsd diff --git a/indra/lib/python/indra/base/lluuid.py b/indra/lib/python/indra/base/lluuid.py index 1cdd8e915b..369ae4e92f 100644 --- a/indra/lib/python/indra/base/lluuid.py +++ b/indra/lib/python/indra/base/lluuid.py @@ -163,7 +163,7 @@ class UUID(object): def setFromMemoryDump(self, gdb_string): """ We expect to get gdb_string as four hex units. eg: - 0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2 + 0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2 Which will be translated to: db547d14-1b3f4bc3-9b984f71-d22f890a Returns self. @@ -187,7 +187,7 @@ class UUID(object): def getAsString(self): """ Return a different string representation of the form - AAAAAAAA-AAAABBBB-BBBBBBBB-BBCCCCCC (a 128-bit number in hex) + AAAAAAAA-AAAABBBB-BBBBBBBB-BBCCCCCC (a 128-bit number in hex) where A=network address, B=timestamp, C=random. """ i1 = _binstr2int(self._bits[0:4]) @@ -233,7 +233,7 @@ NULL = UUID() def printTranslatedMemory(four_hex_uints): """ We expect to get the string as four hex units. eg: - 0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2 + 0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2 Which will be translated to: db547d14-1b3f4bc3-9b984f71-d22f890a """ diff --git a/indra/lib/python/indra/ipc/httputil.py b/indra/lib/python/indra/ipc/httputil.py index c4ac0a379d..d53f34a771 100644 --- a/indra/lib/python/indra/ipc/httputil.py +++ b/indra/lib/python/indra/ipc/httputil.py @@ -1,3 +1,24 @@ +#!/usr/bin/python +## $LicenseInfo:firstyear=2011&license=viewerlgpl$ +## Second Life Viewer Source Code +## Copyright (C) 2011, 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 +## License as published by the Free Software Foundation; +## version 2.1 of the License only. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +## $/LicenseInfo$ import warnings diff --git a/indra/lib/python/indra/ipc/russ.py b/indra/lib/python/indra/ipc/russ.py index 35d8afb158..ac780f128b 100644 --- a/indra/lib/python/indra/ipc/russ.py +++ b/indra/lib/python/indra/ipc/russ.py @@ -110,7 +110,7 @@ def format(format_str, context): def _find_sub_matches(format_str): """@brief Find all of the substitution matches. -@param format_str the RUSS conformant format string. +@param format_str the RUSS conformant format string. @return Returns an array of depths of arrays of positional matches in input. """ depth = 0 diff --git a/indra/lib/python/indra/ipc/siesta_test.py b/indra/lib/python/indra/ipc/siesta_test.py index 177ea710d1..a35eed2460 100644 --- a/indra/lib/python/indra/ipc/siesta_test.py +++ b/indra/lib/python/indra/ipc/siesta_test.py @@ -1,3 +1,24 @@ +#!/usr/bin/python +## $LicenseInfo:firstyear=2011&license=viewerlgpl$ +## Second Life Viewer Source Code +## Copyright (C) 2011, 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 +## License as published by the Free Software Foundation; +## version 2.1 of the License only. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +## $/LicenseInfo$ from indra.base import llsd, lluuid from indra.ipc import siesta import datetime, math, unittest diff --git a/indra/lib/python/indra/util/llperformance.py b/indra/lib/python/indra/util/llperformance.py index 7c52730b5e..57dd64de3f 100755 --- a/indra/lib/python/indra/util/llperformance.py +++ b/indra/lib/python/indra/util/llperformance.py @@ -1,4 +1,28 @@ -#!/usr/bin/python +#!/usr/bin/env python +"""\ +@file llperformance.py + +$LicenseInfo:firstyear=2010&license=viewerlgpl$ +Second Life Viewer Source Code +Copyright (C) 2010-2011, 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 +License as published by the Free Software Foundation; +version 2.1 of the License only. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +$/LicenseInfo$ +""" # ------------------------------------------------ # Sim metrics utility functions. diff --git a/indra/lib/python/indra/util/llversion.py b/indra/lib/python/indra/util/llversion.py index 2718a85f41..ba6f567b60 100644 --- a/indra/lib/python/indra/util/llversion.py +++ b/indra/lib/python/indra/util/llversion.py @@ -1,7 +1,9 @@ -"""@file llversion.py -@brief Utility for parsing llcommon/llversion${server}.h - for the version string and channel string - Utility that parses hg or svn info for branch and revision +#!/usr/bin/env python +"""\ +@file llversion.py +@brief Parses llcommon/llversionserver.h and llcommon/llversionviewer.h + for the version string and channel string. + Parses hg info for branch and revision. $LicenseInfo:firstyear=2006&license=mit$ @@ -27,7 +29,7 @@ THE SOFTWARE. $/LicenseInfo$ """ -import re, sys, os, commands +import re, sys, os, subprocess # Methods for gathering version information from # llversionviewer.h and llversionserver.h @@ -73,29 +75,13 @@ def get_viewer_channel(): def get_server_channel(): return get_channel('server') -# Methods for gathering subversion information -def get_svn_status_matching(regular_expression): - # Get the subversion info from the working source tree - status, output = commands.getstatusoutput('svn info %s' % get_src_root()) - m = regular_expression.search(output) - if not m: - print >> sys.stderr, "Failed to parse svn info output, result follows:" - print >> sys.stderr, output - raise Exception, "No matching svn status in "+src_root - return m.group(1) - -def get_svn_branch(): - branch_re = re.compile('URL: (\S+)') - return get_svn_status_matching(branch_re) - -def get_svn_revision(): - last_rev_re = re.compile('Last Changed Rev: (\d+)') - return get_svn_status_matching(last_rev_re) - +# Methods for gathering hg information def get_hg_repo(): - status, output = commands.getstatusoutput('hg showconfig paths.default') + child = subprocess.Popen(["hg","showconfig","paths.default"], stdout=subprocess.PIPE) + output, error = child.communicate() + status = child.returncode if status: - print >> sys.stderr, output + print >> sys.stderr, error sys.exit(1) if not output: print >> sys.stderr, 'ERROR: cannot find repo we cloned from' @@ -103,24 +89,19 @@ def get_hg_repo(): return output def get_hg_changeset(): - # The right thing to do: - # status, output = commands.getstatusoutput('hg id -i') - # if status: - # print >> sys.stderr, output - # sys.exit(1) - - # The temporary hack: - status, output = commands.getstatusoutput('hg parents --template "{rev}"') + # The right thing to do would be to use the *global* revision id: + # "hg id -i" + # For the moment though, we use the parent revision: + child = subprocess.Popen(["hg","parents","--template","{rev}"], stdout=subprocess.PIPE) + output, error = child.communicate() + status = child.returncode if status: - print >> sys.stderr, output + print >> sys.stderr, error sys.exit(1) lines = output.splitlines() if len(lines) > 1: print >> sys.stderr, 'ERROR: working directory has %d parents' % len(lines) return lines[0] -def using_svn(): - return os.path.isdir(os.path.join(get_src_root(), '.svn')) - def using_hg(): return os.path.isdir(os.path.join(get_src_root(), '.hg')) diff --git a/indra/lib/python/indra/util/simperf_proc_interface.py b/indra/lib/python/indra/util/simperf_proc_interface.py index da6304a274..de061f68cc 100755 --- a/indra/lib/python/indra/util/simperf_proc_interface.py +++ b/indra/lib/python/indra/util/simperf_proc_interface.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python """\ @file simperf_proc_interface.py @brief Utility to extract log messages from *.<pid>.llsd files containing performance statistics. diff --git a/indra/lib/python/indra/util/test_win32_manifest.py b/indra/lib/python/indra/util/test_win32_manifest.py index da8ee6c545..0532cb0065 100644 --- a/indra/lib/python/indra/util/test_win32_manifest.py +++ b/indra/lib/python/indra/util/test_win32_manifest.py @@ -1,28 +1,29 @@ #!/usr/bin/env python -# @file test_win32_manifest.py -# @brief Test an assembly binding version and uniqueness in a windows dll or exe. -# -# $LicenseInfo:firstyear=2009&license=viewerlgpl$ -# Second Life Viewer Source Code -# Copyright (C) 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 -# License as published by the Free Software Foundation; -# version 2.1 of the License only. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# -# Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -# $/LicenseInfo$ - +"""\ +@file test_win32_manifest.py +@brief Test an assembly binding version and uniqueness in a windows dll or exe. + +$LicenseInfo:firstyear=2009&license=viewerlgpl$ +Second Life Viewer Source Code +Copyright (C) 2009-2011, 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 +License as published by the Free Software Foundation; +version 2.1 of the License only. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +$/LicenseInfo$ +""" import sys, os import tempfile from xml.dom.minidom import parse diff --git a/indra/lib/python/uuid.py b/indra/lib/python/uuid.py index 0bc21a35f8..e956383cca 100644 --- a/indra/lib/python/uuid.py +++ b/indra/lib/python/uuid.py @@ -1,3 +1,24 @@ +#!/usr/bin/python +## $LicenseInfo:firstyear=2011&license=viewerlgpl$ +## Second Life Viewer Source Code +## Copyright (C) 2011, 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 +## License as published by the Free Software Foundation; +## version 2.1 of the License only. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +## $/LicenseInfo$ r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions |