/usr/share/pyshared/pyamf/versions.py is in python-pyamf 0.6.1+dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Because there is disparity between Python packaging (and it is being sorted
out ...) we currently provide our own way to get the string of a version tuple.
@since: 0.6
"""
class Version(tuple):
_version = None
def __new__(cls, *args):
x = tuple.__new__(cls, args)
return x
def __str__(self):
if not self._version:
self._version = get_version(self)
return self._version
def get_version(_version):
v = ''
prev = None
for x in _version:
if prev is not None:
if isinstance(x, int):
v += '.'
prev = x
v += str(x)
return v.strip('.')
|