mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-11-14 11:44:45 +08:00
24 lines
445 B
Python
24 lines
445 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
|
|
def _build_unit_registry():
|
|
try:
|
|
from pint import UnitRegistry
|
|
|
|
registry = UnitRegistry()
|
|
registry.define('FPS = 1 * hertz')
|
|
except ImportError:
|
|
class NoUnitRegistry:
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
def __getattr__(self, item):
|
|
return 1
|
|
|
|
registry = NoUnitRegistry()
|
|
|
|
return registry
|
|
|
|
|
|
units = _build_unit_registry()
|