File: __init__.py

package info (click to toggle)
python-pbcommand 2.1.1%2Bgit20220616.3f2e6c2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 940 kB
  • sloc: python: 6,929; makefile: 220; sh: 71
file content (27 lines) | stat: -rw-r--r-- 530 bytes parent folder | download | duplicates (3)
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
import pkg_resources
import sys

try:
    __VERSION__ = pkg_resources.get_distribution('pbcommand').version
except Exception:
    __VERSION__ = 'unknown'

VERSION = (int(x) for x in __VERSION__.split('.'))


def get_version():
    """Return the version as a string. "1.0.0"

    This uses a major.minor.tiny to be compatible with semver spec.

    .. note:: This should be improved to be compliant with PEP 386.
    """
    return ".".join([str(i) for i in VERSION])


def to_ascii(s):
    return s


def to_utf8(s):
    return s