Python script to restore the metadata for a Deckset file after it is in version control, via xattr. Set your preferred Theme name and Colorscheme in top of file.
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
!/usr/bin/env python | |
# | |
# Quick Script to Fix the Local Settings of Deckset Themes | |
# | |
# Deckset uses `xattr` metadata which isn't preserved | |
# by version control. | |
# | |
# Note that Vim will also overwrite your metadata unless you `set backupcopy=yes` | |
# | |
# Brendan McAdams <brendan@boldradius.com> | |
# | |
import xattr | |
import glob | |
StandardTheme = "next" | |
StandardColors = "scheme9" # black with white text | |
print "\n For all Presentations in Filetree, setting Theme '%s' with Color Scheme '%s'..." % (StandardTheme, StandardColors) | |
for f in glob.glob('*/*.md'): | |
print "\t *** Fixing '%s'" % f | |
xattr.setxattr(f, 'com.decksetapp.Theme', StandardTheme) | |
xattr.setxattr(f, 'com.decksetapp.ColorScheme', StandardColors) | |
print " Done." | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xattr should ship with OS X's default Python. It was on my freshly installed machine with no extra install.