Skip to content

Instantly share code, notes, and snippets.

@junfenglx
Last active August 29, 2015 14:05
Show Gist options
  • Save junfenglx/b49b6108bceb54081b0f to your computer and use it in GitHub Desktop.
Save junfenglx/b49b6108bceb54081b0f to your computer and use it in GitHub Desktop.
copy_ActionBar_Icons_to_ecplise_project (http://yun.baidu.com/share/link?shareid=2579880139&uk=2887257007)
import os
import os.path
ROOT = "."
THEME = "holo_dark"
SRC = os.path.join(ROOT, THEME)
TO = os.path.join(ROOT, "res")
for root, dirs, files in os.walk(SRC):
if not files:
continue
icon_version = root.split("\\")[-1]
to = os.path.join(TO, icon_version)
for f in files:
icon_from = os.path.join(root, f)
icon_to = os.path.join(to, f)
print "Copy from:", icon_from
print "To:", icon_to
assert icon_from.split("\\")[-2] == icon_to.split("\\")[-2]
with open(icon_from, "rb") as fr:
with open(icon_to, "wb") as fw:
fw.write(fr.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment