diff options
author | Christian Struck <christian@struck.se> | 2013-01-28 18:14:23 +0100 |
---|---|---|
committer | Christian Struck <christian@struck.se> | 2013-01-28 18:14:23 +0100 |
commit | 80cc719d353eb5ec511aeeef309218dea1d768a7 (patch) | |
tree | 51c1d7ea171c007381c81f868c882cd4d8a0418f /bvggrabber/utils | |
parent | 8c2de5d4a9802e43ceb7630e933655859aa80fe0 (diff) | |
download | bvg-grabber-80cc719d353eb5ec511aeeef309218dea1d768a7.tar.gz bvg-grabber-80cc719d353eb5ec511aeeef309218dea1d768a7.tar.bz2 bvg-grabber-80cc719d353eb5ec511aeeef309218dea1d768a7.zip |
Fixed a bug, where the Vehicle conversion did not work properly
Diffstat (limited to 'bvggrabber/utils')
-rw-r--r-- | bvggrabber/utils/__init__.py | 0 | ||||
-rw-r--r-- | bvggrabber/utils/format.py | 7 |
2 files changed, 7 insertions, 0 deletions
diff --git a/bvggrabber/utils/__init__.py b/bvggrabber/utils/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/bvggrabber/utils/__init__.py diff --git a/bvggrabber/utils/format.py b/bvggrabber/utils/format.py new file mode 100644 index 0000000..98bbaee --- /dev/null +++ b/bvggrabber/utils/format.py @@ -0,0 +1,7 @@ +#-*- coding: utf-8 -*- + +def int2bin(i, length): + + if not isinstance(length, int): + raise ValueError("expected int for length") + return ('{:0>' + str(length) + 'b}').format(i) |