Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyOneNote/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def process_onenote_file(file, output_dir, extension, json_output):
exit()

file.seek(0)
document = OneDocment(file)
document = OneDocument(file)
data = document.get_json()
if not json_output:
print('Headers\n####################################################################')
Expand Down Expand Up @@ -58,8 +58,8 @@ def process_onenote_file(file, output_dir, extension, json_output):
) as output_file:
output_file.write(file["content"])
counter += 1

return json.dumps(document.get_json())
else:
print(json.dumps(data))


def get_hex_format(hex_str, col, indent):
Expand All @@ -81,7 +81,7 @@ def main():
args = p.parse_args()

if not os.path.exists(args.file):
sys.exit("File: %s doesn't exist", args.file)
sys.exit("File: '{}' doesn't exist".format(args.file))

with open(args.file, "rb") as file:
process_onenote_file(file, args.output_dir, args.extension, args.json)
Expand Down
8 changes: 4 additions & 4 deletions pyOneNote/OneDocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json


class OneDocment:
class OneDocument:
def __init__(self, file):
self.header = Header(file)
self.root_file_node_list = FileNodeList(file, self.header.fcrFileNodeListRoot)
Expand All @@ -19,7 +19,7 @@ def traverse_nodes(root_file_node_list, nodes, filters):
nodes.append(file_node)

for child_file_node_list in file_node.children:
OneDocment.traverse_nodes(child_file_node_list, nodes, filters)
OneDocument.traverse_nodes(child_file_node_list, nodes, filters)

def get_properties(self):
if self._properties:
Expand All @@ -29,7 +29,7 @@ def get_properties(self):

self._properties = []

OneDocment.traverse_nodes(self.root_file_node_list, nodes, filters)
OneDocument.traverse_nodes(self.root_file_node_list, nodes, filters)
for node in nodes:
if hasattr(node, 'propertySet'):
node.propertySet.body.indent= '\t\t'
Expand All @@ -44,7 +44,7 @@ def get_files(self):
self._files = {}
filters = ["FileDataStoreObjectReferenceFND", "ObjectDeclarationFileData3RefCountFND"]

OneDocment.traverse_nodes(self.root_file_node_list, nodes, filters)
OneDocument.traverse_nodes(self.root_file_node_list, nodes, filters)

for node in nodes:
if hasattr(node, "data") and node.data:
Expand Down