~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugin.py

  • Committer: Marius Kruger
  • Date: 2008-10-15 21:48:10 UTC
  • mto: This revision was merged to the branch mainline in revision 3821.
  • Revision ID: amanic@gmail.com-20081015214810-x3rd3z5ow2oi8415
Use bzrlib._format_version_tuple and map as per review from John.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
import zipfile
42
42
 
43
43
from bzrlib import (
 
44
    _format_version_tuple,
44
45
    config,
45
46
    debug,
46
47
    errors,
460
461
        if version_info is None or len(version_info) == 0:
461
462
            return "unknown"
462
463
        try:
463
 
            if version_info[3] == 'final':
464
 
                version_string = '%d.%d.%d' % version_info[:3]
465
 
            else:
466
 
                version_string = '%d.%d.%d%s%d' % version_info
 
464
            version_string = _format_version_tuple(version_info)
467
465
        except:
468
466
            # try to return something usefull for bad plugins, in stead of
469
467
            # stack tracing.
470
 
            version_string = '.'.join([str(x) for x in version_info])
 
468
            version_string = '.'.join(map(str, version_info))
471
469
        return version_string
472
470
 
473
471
    __version__ = property(_get__version__)