split platform

This commit is contained in:
j 2016-02-06 15:06:57 +05:30
commit 8c9b09577d
2261 changed files with 676163 additions and 0 deletions

View file

@ -0,0 +1,56 @@
<?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>BuildMachineOSBuild</key>
<string>15D21</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Open Media Library</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>com.openmedialibrary.Open-Media-Library</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Open Media Library</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.6</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>10.11</string>
<key>LSUIElement</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 Open Media Library. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View file

@ -0,0 +1 @@
APPL????

View file

@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Open Media Library</title>
<meta charset="UTF-8"/>
<link href="/png/oml.png" rel="icon" type="image/png">
<script src="/js/install.js" type="text/javascript"></script>
<meta name="google" value="notranslate"/>
</head>
<body></body>
</html>

View file

@ -0,0 +1,24 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Open Media Library</title>
</head>
<body>
<script>
function load() {
var base = 'http://127.0.0.1:9841';
var xhr = new XMLHttpRequest();
xhr.onload = function() {
document.location.href = base;
};
xhr.onerror = function() {
setTimeout(load, 1000);
}
xhr.open('get', base + '/status');
xhr.send();
}
load();
</script>
</body>
</html>

View file

@ -0,0 +1,136 @@
#!/usr/bin/env python
from __future__ import division, with_statement
from contextlib import closing
import json
import os
import sys
import time
import tarfile
import urllib2
import SimpleHTTPServer
import SocketServer
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):
self.send_response(200, 'OK')
self.send_header('Allow', 'GET, POST, OPTIONS')
self.send_header('Access-Control-Allow-Origin', '*')
self.send_header('Access-Control-Allow-Headers', 'X-Requested-With')
self.send_header('Content-Length', '0')
self.end_headers()
def do_GET(self):
if self.path == '/status':
content = json.dumps(self.server.install.status)
self.send_response(200, 'OK')
else:
path = os.path.join(static_dir, 'index.html' if self.path == '/' else self.path[1:])
if os.path.exists(path):
with open(path) as fd:
content = fd.read()
self.send_response(200, 'OK')
content_type = {
'html': 'text/html',
'png': 'image/png',
'svg': 'image/svg+xml',
'txt': 'text/plain',
}.get(path.split('.')[-1], 'txt')
self.send_header('Content-Type', content_type)
else:
self.send_response(404, 'not found')
content = '404 not found'
self.send_header('Access-Control-Allow-Origin', '*')
self.send_header('Content-Length', str(len(content)))
self.end_headers()
self.wfile.write(content)
class Install(Thread):
release_url = "http://downloads.openmedialibrary.com/release.json"
status = {
'step': 'Downloading...'
}
def __init__(self, target, httpd):
target = os.path.normpath(os.path.join(os.path.abspath(target)))
self.target = target
self.httpd = httpd
Thread.__init__(self)
self.daemon = True
self.start()
def run(self):
target = self.target
makedirs(target)
os.chdir(target)
self.status["step"] = 'Downloading...'
release = self.get_release()
self.status["release"] = release
self.status["progress"] = 0
for module in sorted(release['modules']):
package_tar = release['modules'][module]['name']
url = self.release_url.replace('release.json', package_tar)
self.download(url, package_tar)
self.status["step"] = 'Installing...'
for module in sorted(release['modules']):
package_tar = release['modules'][module]['name']
tar = tarfile.open(package_tar)
tar.extractall()
tar.close()
os.unlink(package_tar)
os.symlink('openmedialibrary/ctl', 'ctl')
makedirs('data')
with open('data/release.json', 'w') as fd:
json.dump(release, fd, indent=2)
self.status = {"relaunch": True}
os.system("./ctl start &")
time.sleep(5)
self.httpd.shutdown()
def download(self, url, filename):
dirname = os.path.dirname(filename)
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))
self.status["size"] = size
available = 0
data = u.read(4096)
while data:
if size:
available += len(data)
f.write(data)
data = u.read(4096)
def get_release(self):
with closing(urllib2.urlopen(self.release_url)) as u:
data = json.load(u)
return data
if __name__ == '__main__':
if len(sys.argv) == 1:
target = os.path.expanduser("~/Library/Application Support/Open Media Library")
elif len(sys.argv) != 2:
print "usage: %s [target]" % sys.argv[0]
sys.exit(1)
else:
target = sys.argv[1]
SocketServer.TCPServer.allow_reuse_address = True
httpd = SocketServer.TCPServer(("", PORT), Handler)
install = Install(target, httpd)
httpd.install = install
httpd.serve_forever()

View file

@ -0,0 +1,148 @@
'use strict';
(function() {
loadImages(function(images) {
loadScreen(images);
initUpdate();
});
function initUpdate(browserSupported) {
window.update = {};
update.status = document.createElement('div');
update.status.className = 'OxElement';
update.status.style.position = 'absolute';
update.status.style.left = '16px';
update.status.style.top = '336px';
update.status.style.right = 0;
update.status.style.bottom = 0;
update.status.style.width = '512px';
update.status.style.height = '16px';
update.status.style.margin = 'auto';
update.status.style.textAlign = 'center';
update.status.style.color = 'rgb(16, 16, 16)';
update.status.style.fontFamily = 'Lucida Grande, Segoe UI, DejaVu Sans, Lucida Sans Unicode, Helvetica, Arial, sans-serif';
update.status.style.fontSize = '11px';
document.querySelector('#loadingScreen').appendChild(update.status);
update.status.innerHTML = '';
updateStatus();
}
function load() {
var base = '//127.0.0.1:9842',
ws = new WebSocket('ws:' + base + '/ws');
ws.onopen = function(event) {
document.location.href = 'http:' + base;
};
ws.onerror = function(event) {
ws.close();
setTimeout(load, 500);
};
ws.onclose = function(event) {
setTimeout(load, 500);
};
}
function loadImages(callback) {
var images = {};
images.logo = document.createElement('img');
images.logo.onload = function() {
images.logo.style.position = 'absolute';
images.logo.style.left = 0;
images.logo.style.top = 0;
images.logo.style.right = 0;
images.logo.style.bottom = '96px';
images.logo.style.width = '256px';
images.logo.style.height = '256px';
images.logo.style.margin = 'auto';
images.logo.style.MozUserSelect = 'none';
images.logo.style.MSUserSelect = 'none';
images.logo.style.OUserSelect = 'none';
images.logo.style.WebkitUserSelect = 'none';
images.loadingIcon = document.createElement('img');
images.loadingIcon.setAttribute('id', 'loadingIcon');
images.loadingIcon.style.position = 'absolute';
images.loadingIcon.style.left = '16px';
images.loadingIcon.style.top = '256px'
images.loadingIcon.style.right = 0;
images.loadingIcon.style.bottom = 0;
images.loadingIcon.style.width = '32px';
images.loadingIcon.style.height = '32px';
images.loadingIcon.style.margin = 'auto';
images.loadingIcon.style.MozUserSelect = 'none';
images.loadingIcon.style.MSUserSelect = 'none';
images.loadingIcon.style.OUserSelect = 'none';
images.loadingIcon.style.WebkitUserSelect = 'none';
images.loadingIcon.src = '/svg/symbolLoading.svg';
callback(images);
};
images.logo.src = '/png/oml.png';
}
function loadScreen(images) {
var loadingScreen = document.createElement('div');
loadingScreen.setAttribute('id', 'loadingScreen');
loadingScreen.className = 'OxScreen';
loadingScreen.style.position = 'absolute';
loadingScreen.style.width = '100%';
loadingScreen.style.height = '100%';
loadingScreen.style.backgroundColor = 'rgb(224, 224, 224)';
loadingScreen.style.zIndex = '1002';
loadingScreen.appendChild(images.logo);
loadingScreen.appendChild(images.loadingIcon);
// FF3.6 document.body can be undefined here
window.onload = function() {
document.body.style.margin = 0;
document.body.appendChild(loadingScreen);
startAnimation();
};
// IE8 does not call onload if already loaded before set
document.body && window.onload();
}
function startAnimation() {
var css, deg = 0, loadingIcon = document.getElementById('loadingIcon'),
previousTime = +new Date();
var animationInterval = setInterval(function() {
var currentTime = +new Date(),
delta = (currentTime - previousTime) / 1000;
previousTime = currentTime;
deg = Math.round((deg + delta * 360) % 360 / 30) * 30;
css = 'rotate(' + deg + 'deg)';
loadingIcon.style.MozTransform = css;
loadingIcon.style.MSTransform = css;
loadingIcon.style.OTransform = css;
loadingIcon.style.WebkitTransform = css;
loadingIcon.style.transform = css;
}, 83);
}
function updateStatus() {
var xhr = new XMLHttpRequest();
xhr.onload = function() {
var response = JSON.parse(this.responseText);
if (response.step) {
var status = response.step;
if (response.progress) {
status = parseInt(response.progress * 100) + '% ' + status;
}
update.status.innerHTML = status;
setTimeout(updateStatus, 1000);
} else {
update.status.innerHTML = 'Relaunching...';
setTimeout(load, 500);
}
};
xhr.onerror = function() {
var status = update.status.innerHTML;
if (['Relaunching...', ''].indexOf(status) == -1) {
update.status.innerHTML = 'Installation failed';
}
load();
}
xhr.open('get', '/status');
xhr.send();
}
}());

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View file

@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256">
<g transform="translate(128, 128)" stroke="#808080" stroke-linecap="round" stroke-width="28">
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(0)" opacity="1"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(30)" opacity="0.083333"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(60)" opacity="0.166667"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(90)" opacity="0.25"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(120)" opacity="0.333333"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(150)" opacity="0.416667"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(180)" opacity="0.5"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(210)" opacity="0.583333"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(240)" opacity="0.666667"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(270)" opacity="0.75"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(300)" opacity="0.833333"/>
<line x1="0" y1="-114" x2="0" y2="-70" transform="rotate(330)" opacity="0.916667"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,270 @@
<?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>files</key>
<dict>
<key>Resources/AppIcon.icns</key>
<data>
uJXVB1wchnMfESqlu15aymGkfzU=
</data>
<key>Resources/Assets.car</key>
<data>
J0bcbd6bu3teEBZKNEEQTcykNSI=
</data>
<key>Resources/Base.lproj/MainMenu.nib</key>
<dict>
<key>hash</key>
<data>
wu5QbfHAcRte07MP8HrD2VGTxss=
</data>
<key>optional</key>
<true/>
</dict>
<key>Resources/index.html</key>
<data>
JIBakF3URAgkk7dR8veswSN9zLI=
</data>
<key>Resources/install.html</key>
<data>
HSrvBNGr2ZorlpsVkPW8WhxHmJU=
</data>
<key>Resources/install.py</key>
<data>
8P8EjUEoWuHCRIRvQTi7vbDhGoM=
</data>
<key>Resources/js/install.js</key>
<data>
Vm6iTydoG1DWT+GNOLDV51fPEaA=
</data>
<key>Resources/png/oml.png</key>
<data>
yAW1cp8HHJoIRTYucCTGeG575vM=
</data>
<key>Resources/svg/symbolLoading.svg</key>
<data>
bp9z14AgWlNHFY+FF4dBnbl127s=
</data>
</dict>
<key>files2</key>
<dict>
<key>Frameworks/libswiftAppKit.dylib</key>
<dict>
<key>cdhash</key>
<data>
BfWCqDz3l/ei3lMoRHzUs0Faz1I=
</data>
<key>requirement</key>
<string>cdhash H"05f582a83cf797f7a2de5328447cd4b3415acf52"</string>
</dict>
<key>Frameworks/libswiftCore.dylib</key>
<dict>
<key>cdhash</key>
<data>
KErlQnFHB1oAtlbBqagrepY0Pi0=
</data>
<key>requirement</key>
<string>cdhash H"284ae5427147075a00b656c1a9a82b7a96343e2d"</string>
</dict>
<key>Frameworks/libswiftCoreData.dylib</key>
<dict>
<key>cdhash</key>
<data>
+qOGIC1K4Jw18cvmWMeAL/7vb30=
</data>
<key>requirement</key>
<string>cdhash H"faa386202d4ae09c35f1cbe658c7802ffeef6f7d"</string>
</dict>
<key>Frameworks/libswiftCoreGraphics.dylib</key>
<dict>
<key>cdhash</key>
<data>
gMATYaSfUYMCuY6NOWxpSdXV0rc=
</data>
<key>requirement</key>
<string>cdhash H"80c01361a49f518302b98e8d396c6949d5d5d2b7"</string>
</dict>
<key>Frameworks/libswiftCoreImage.dylib</key>
<dict>
<key>cdhash</key>
<data>
xmyuSLfv82vL65/t1QEU7z/DC48=
</data>
<key>requirement</key>
<string>cdhash H"c66cae48b7eff36bcbeb9fedd50114ef3fc30b8f"</string>
</dict>
<key>Frameworks/libswiftDarwin.dylib</key>
<dict>
<key>cdhash</key>
<data>
TjFVRc30ZSuhgWSatSHtAUEyiqM=
</data>
<key>requirement</key>
<string>cdhash H"4e315545cdf4652ba181649ab521ed0141328aa3"</string>
</dict>
<key>Frameworks/libswiftDispatch.dylib</key>
<dict>
<key>cdhash</key>
<data>
yBUpkqP7Wv2E7BLzAMjTMV5pPIU=
</data>
<key>requirement</key>
<string>cdhash H"c8152992a3fb5afd84ec12f300c8d3315e693c85"</string>
</dict>
<key>Frameworks/libswiftFoundation.dylib</key>
<dict>
<key>cdhash</key>
<data>
sf16n9ERJGQqjYPT05wC3zeiItQ=
</data>
<key>requirement</key>
<string>cdhash H"b1fd7a9fd11124642a8d83d3d39c02df37a222d4"</string>
</dict>
<key>Frameworks/libswiftObjectiveC.dylib</key>
<dict>
<key>cdhash</key>
<data>
4R3j0BKBovRFuiMv3qqfuODkyB8=
</data>
<key>requirement</key>
<string>cdhash H"e11de3d01281a2f445ba232fdeaa9fb8e0e4c81f"</string>
</dict>
<key>Resources/AppIcon.icns</key>
<data>
uJXVB1wchnMfESqlu15aymGkfzU=
</data>
<key>Resources/Assets.car</key>
<data>
J0bcbd6bu3teEBZKNEEQTcykNSI=
</data>
<key>Resources/Base.lproj/MainMenu.nib</key>
<dict>
<key>hash</key>
<data>
wu5QbfHAcRte07MP8HrD2VGTxss=
</data>
<key>optional</key>
<true/>
</dict>
<key>Resources/index.html</key>
<data>
JIBakF3URAgkk7dR8veswSN9zLI=
</data>
<key>Resources/install.html</key>
<data>
HSrvBNGr2ZorlpsVkPW8WhxHmJU=
</data>
<key>Resources/install.py</key>
<data>
8P8EjUEoWuHCRIRvQTi7vbDhGoM=
</data>
<key>Resources/js/install.js</key>
<data>
Vm6iTydoG1DWT+GNOLDV51fPEaA=
</data>
<key>Resources/png/oml.png</key>
<data>
yAW1cp8HHJoIRTYucCTGeG575vM=
</data>
<key>Resources/svg/symbolLoading.svg</key>
<data>
bp9z14AgWlNHFY+FF4dBnbl127s=
</data>
</dict>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>