Project

General

Profile

« Previous | Next » 

Revision 7de08f2f

Added by dsorber almost 12 years ago

Wrote a converter util and started working on the importer util.

View differences:

software/bookmark_library/utils/bookmark_converter.py
import re
import sys
def main():
""" The purpose of this script is to convert the output of a bookmarks
export from Google Chrome into something more useful for the bookmark
import script.
"""
if len(sys.argv) < 2:
print('ERROR: not enough arguments provided')
file_contents = open(sys.argv[1]).read()
matches = re.finditer('<A HREF=\"(.+?)\".+ADD_DATE=\"(.+?)\"',
file_contents)
for match in matches:
print('{:s} {:s}'.format(match.group(1), match.group(2)))
if __name__ == '__main__':
main()
software/bookmark_library/utils/bookmark_importer.py
import sys
import sqlite3
from lib.bookmark import Bookmark
from lib.tag import Tag
def main():
pass
if __name__ == '__main__':
main()

Also available in: Unified diff