Created
June 1, 2011 04:43
-
-
Save rosskarchner/1001799 to your computer and use it in GitHub Desktop.
Script that adds OpenMeta tags to Pukka cache
This file contains hidden or 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
#! /usr/bin/python | |
#requires: openmeta command line tool, openmeta python library | |
from glob import glob | |
from plistlib import readPlistFromString | |
import shlex, subprocess, openmeta | |
get_xml="plutil -convert xml1 -o - %s" | |
bookmarks= glob('/Users/theross/Library/Caches/Metadata/Pukka/*/*.pukkabookmark') | |
for bookmark in bookmarks: | |
args = shlex.split(get_xml % bookmark) | |
xml= subprocess.Popen(args, stdout=subprocess.PIPE) | |
out, err= xml.communicate() | |
tags= readPlistFromString(out)['Tags'] | |
openmeta.set_tags(bookmark, tags) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment