From 118a8e7371167cc8f2be6e2c8d50849fbc55547f Mon Sep 17 00:00:00 2001 From: j Date: Mon, 18 Jan 2016 12:06:31 +0530 Subject: [PATCH] migrate config->data --- Open Media Library/Info.plist | 32 ++++++++++++++++++++----- Open Media Library/Resources/install.py | 15 +++++++----- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/Open Media Library/Info.plist b/Open Media Library/Info.plist index a1b5949..068c940 100644 --- a/Open Media Library/Info.plist +++ b/Open Media Library/Info.plist @@ -2,28 +2,48 @@ + BuildMachineOSBuild + 15C50 CFBundleDevelopmentRegion en CFBundleExecutable - $(EXECUTABLE_NAME) + Open Media Library CFBundleIconFile - + AppIcon CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) + com.openmedialibrary.Open-Media-Library CFBundleInfoDictionaryVersion 6.0 CFBundleName - $(PRODUCT_NAME) + Open Media Library CFBundlePackageType APPL CFBundleShortVersionString - 0.4 + 0.5 CFBundleSignature ???? + CFBundleSupportedPlatforms + + MacOSX + CFBundleVersion 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 7C68 + DTPlatformVersion + GM + DTSDKBuild + 15C43 + DTSDKName + macosx10.11 + DTXcode + 0720 + DTXcodeBuild + 7C68 LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) + 10.11 LSUIElement NSHumanReadableCopyright diff --git a/Open Media Library/Resources/install.py b/Open Media Library/Resources/install.py index 0dc329b..32a379d 100755 --- a/Open Media Library/Resources/install.py +++ b/Open Media Library/Resources/install.py @@ -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))