-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtil.py
32 lines (24 loc) · 900 Bytes
/
Util.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#-*- coding: utf-8 -*-
import os, sys
import subprocess
class Util(object):
def rename(self, src, changed):
rename = "mv {src} {changed}".format(src=src, changed=changed)
subprocess.call ( rename , shell=True)
def make_substrate_plist(self, plist_path):
plist_value = "{ Filter = { Bundles = (\"com.apple.UIKit\",); }; }"
with open(plist_path, "w") as f:
f.write(plist_value)
def make_target_plist(self, plist_path, target_name):
plist_value = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>{target_name}</key>
<true/>
<key>enabled</key>
<true/>
</dict>
</plist>""".format(target_name=target_name)
with open(plist_path, "w") as f:
f.write(plist_value)