migrate config->data

This commit is contained in:
j 2016-01-18 12:06:31 +05:30
parent eb648284a6
commit 118a8e7371
2 changed files with 35 additions and 12 deletions

View file

@ -2,28 +2,48 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>15C50</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<string>Open Media Library</string>
<key>CFBundleIconFile</key>
<string></string>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.openmedialibrary.Open-Media-Library</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<string>Open Media Library</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.4</string>
<string>0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>7C68</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>15C43</string>
<key>DTSDKName</key>
<string>macosx10.11</string>
<key>DTXcode</key>
<string>0720</string>
<key>DTXcodeBuild</key>
<string>7C68</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<string>10.11</string>
<key>LSUIElement</key>
<true/>
<key>NSHumanReadableCopyright</key>

View file

@ -16,6 +16,9 @@ from threading import Thread
PORT = 9841
static_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
def makedirs(dirname):
if not os.path.exists(dirname):
os.makedirs(dirname)
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_OPTIONS(self):
@ -61,8 +64,7 @@ class Install(Thread):
def run(self):
target = self.target
if not os.path.exists(target):
os.makedirs(target)
makedirs(target)
os.chdir(target)
release = self.get_release()
self.status["release"] = release
@ -84,18 +86,19 @@ class Install(Thread):
self.status["step"] = "setup"
os.system("./ctl setup")
self.status["progress"] = 1
with open('config/release.json', 'w') as fd:
makedirs('data')
with open('data/release.json', 'w') as fd:
json.dump(release, fd, indent=2)
self.status = {"installation finished. starting...": True}
os.system("./ctl start &")
time.sleep(1)
self.httpd.shutdown()
def download(self, url, filename):
dirname = os.path.dirname(filename)
if dirname and not os.path.exists(dirname):
os.makedirs(dirname)
if dirname:
makedirs(dirname)
with open(filename, 'w') as f:
with closing(urllib2.urlopen(url)) as u:
size = int(u.headers.get('content-length', 0))