Created
December 21, 2019 22:42
-
-
Save menyf/6e440a2b5fd9451aae993deae9bb4d99 to your computer and use it in GitHub Desktop.
Including the url to domains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
class MrCItem: | |
def __init__(self, vals): | |
# Title,"Login URL","Login Username","Login Password","Additional URLs" | |
self.title = vals[0] | |
self.loginURL = vals[1] | |
self.username = vals[2] | |
self.password = vals[3] | |
self.additionalURL = self.title if vals[4][:-1] == "" else (self.title + ";" + vals[4][:-1]) | |
def __str__(self): | |
# return "%s" % self.__dict__ | |
keys = ["title", "loginURL", "username", "password", "additionalURL"] | |
ret = "" | |
for key in keys: | |
ret += self.__dict__[key] + "," | |
return ret[:-1] | |
items = [] | |
with open('pm_export.csv', 'r') as f: | |
text = f.readlines() | |
for line in text: | |
values = line.split(",") | |
items.append(MrCItem(values)) | |
for item in items: | |
print(item) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment