Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError when joining lines #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
24 changes: 12 additions & 12 deletions PyWMIPersistenceFinder.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
#
#
# PyWMIPersistenceFinder.py
# Version 1.1
#
Expand Down Expand Up @@ -91,13 +91,13 @@ def main():

#Read objects.data 4 lines at a time to look for bindings
objects_file = open(sys.argv[1], "rb")
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list = [current_line]
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list.append(current_line)
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list.append(current_line)
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list.append(current_line)

#Precompiled match objects to search each line with
Expand Down Expand Up @@ -137,7 +137,7 @@ def main():
"event_filter_name":event_filter_name}

# Increment lines and look again
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list.append(current_line)
lines_list.pop(0)

Expand All @@ -148,13 +148,13 @@ def main():

# Read objects.data 4 lines at a time to look for filters and consumers
objects_file = open(sys.argv[1], "rb")
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list = [current_line]
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list.append(current_line)
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list.append(current_line)
current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list.append(current_line)

while current_line:
Expand Down Expand Up @@ -207,11 +207,11 @@ def main():
filter_match.groups()[2])
filter_dict[event_filter_name].add(filter_details)

current_line = objects_file.readline()
current_line = str(objects_file.readline())
lines_list.append(current_line)
lines_list.pop(0)
objects_file.close()

# Print results to stdout. CSV will be in future version.
print("\n Bindings:\n")
for binding_name, binding_details in bindings_dict.iteritems():
Expand Down