Skip to content

Commit 1ab68bb

Browse files
committed
Merge branch 'release-0.2.0'
2 parents aac56b0 + 549656b commit 1ab68bb

20 files changed

+1122
-1094
lines changed

bof/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
The content of this class should not be used directly, unless writing a
1515
new protocol submodule. Available from direct bof import (``import bof``)
1616
17+
:frame:
18+
Generic frame representation as objects within BOF. Classes from this
19+
submodule should be inherited by protocol implementations, but they should
20+
not be used directly by the end user.
21+
1722
:byte:
1823
Set of functions for byte conversion and handling. Accessed via import of
1924
the byte submodule (``from bof import byte``).
@@ -31,4 +36,6 @@
3136

3237
from .base import *
3338
from .network import *
39+
from .frame import *
3440
from .byte import *
41+
from .spec import *

bof/base.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"""
77

88
import logging
9-
import json
109
from datetime import datetime
1110
from re import sub
1211

@@ -102,25 +101,10 @@ def log(message:str, level:str="INFO") -> bool:
102101
logging.log(level, message)
103102
return _LOGGING_ENABLED
104103

105-
###############################################################################
106-
# BOF JSON FILE HANDLING #
107-
###############################################################################
108-
109-
def load_json(filename:str) -> dict:
110-
"""Loads a JSON file and returns the associated dictionary.
111-
112-
:raises BOFLibraryError: if the file cannot be opened.
113-
"""
114-
try:
115-
with open(filename, 'r') as jsonfile:
116-
return json.load(jsonfile)
117-
except Exception as e:
118-
raise BOFLibraryError("JSON File {0} cannot be used.".format(filename)) from None
119-
120104
###############################################################################
121105
# STRING MANIPULATION #
122106
###############################################################################
123107

124108
def to_property(value:str) -> str:
125109
"""Replace all non alphanumeric characters in a string with ``_``"""
126-
return sub('[^0-9a-zA-Z]+', '_', value)
110+
return sub('[^0-9a-zA-Z]+', '_', value.lower())

0 commit comments

Comments
 (0)