Pyocf minor api fixes
Signed-off-by: Kamil Lepek <kamil.lepek94@gmail.com>
This commit is contained in:
parent
43d6dd7a1c
commit
70142eef7f
@ -6,8 +6,6 @@ from ctypes import c_void_p, cdll
|
|||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
|
|
||||||
lib = None
|
|
||||||
|
|
||||||
|
|
||||||
class OcfLib:
|
class OcfLib:
|
||||||
__lib__ = None
|
__lib__ = None
|
||||||
|
@ -16,7 +16,7 @@ def print_buffer(buf, length, offset=0, width=16, ignore=0,
|
|||||||
stop_after_count_ignored = int(stop_after_count_ignored / width)
|
stop_after_count_ignored = int(stop_after_count_ignored / width)
|
||||||
|
|
||||||
for addr in range(offset, end, width):
|
for addr in range(offset, end, width):
|
||||||
cur_line = buf[addr: min(end, addr + width)]
|
cur_line = buf[addr : min(end, addr + width)]
|
||||||
byteline = ""
|
byteline = ""
|
||||||
asciiline = ""
|
asciiline = ""
|
||||||
if not any(x != ignore for x in cur_line):
|
if not any(x != ignore for x in cur_line):
|
||||||
@ -114,7 +114,7 @@ class Size:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def sectors(self):
|
def sectors(self):
|
||||||
return self.bytes // _SECTOR_SIZE
|
return self.bytes // self._SECTOR_SIZE
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.bytes < self._KiB:
|
if self.bytes < self._KiB:
|
||||||
|
Loading…
Reference in New Issue
Block a user