Skip to content

Instantly share code, notes, and snippets.

@menyf
Created December 21, 2019 22:42
Show Gist options
  • Save menyf/6e440a2b5fd9451aae993deae9bb4d99 to your computer and use it in GitHub Desktop.
Save menyf/6e440a2b5fd9451aae993deae9bb4d99 to your computer and use it in GitHub Desktop.
Including the url to domains
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