Compare commits

..

No commits in common. "5da22eed8e6fc9305d311bd469d03d085c628f62" and "2682af069be3d4d021b356ac38f29c266cb016d8" have entirely different histories.

6 changed files with 15 additions and 39 deletions

View File

@ -1,13 +0,0 @@
#!/usr/bin/env python3
import os
home_dir = os.getenv('HOME')
env = {
"HOME_DIR": home_dir,
"CONFIG_DIR": os.path.join(home_dir, '.config'),
"CACHE_DIR": os.path.join(home_dir, '.cache'),
"LANG": os.environ['LANG'] or "en_US.UTF-8"
}

View File

@ -18,7 +18,6 @@ class Inject:
code = open(self.abspath('./inject.js'), 'r').read() code = open(self.abspath('./inject.js'), 'r').read()
frame = WebKit2.UserContentInjectedFrames.ALL_FRAMES frame = WebKit2.UserContentInjectedFrames.ALL_FRAMES
time = WebKit2.UserScriptInjectionTime.END time = WebKit2.UserScriptInjectionTime.END
code = code.replace("'{{env}}'", json.dumps(env)) code = code.replace("'{{env}}'", json.dumps(env))
code = code.replace("{{uuid}}", webview.uuid) code = code.replace("{{uuid}}", webview.uuid)
code = code.replace("{{app_name}}", webview.app_name) code = code.replace("{{app_name}}", webview.app_name)

View File

@ -7,9 +7,6 @@ import gi
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
from gi.repository import GdkPixbuf from gi.repository import GdkPixbuf
def noop():
pass
def get_monitor_info(monitor): def get_monitor_info(monitor):
return { return {
"model": monitor.props.model, "model": monitor.props.model,

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
build = (0, 6, 1) build = (0, 6, 0)
version = '.'.join(map(str, build)) version = '.'.join(map(str, build))

View File

@ -31,13 +31,24 @@ try:
except: except:
Keybinder = None Keybinder = None
from ._env import env
from ._version import version from ._version import version
from ._settings import create_setting from ._settings import create_setting
from ._protocal import create_protocal from ._protocal import create_protocal
from ._notify import create_notify from ._notify import create_notify
from ._inject import Inject from ._inject import Inject
from ._utils import noop, get_monitor_info, pixbuf_to_dict, dict_to_pixbuf from ._utils import get_monitor_info, pixbuf_to_dict, dict_to_pixbuf
env = {
"HOME_DIR": os.getenv('HOME'),
"CONFIG_DIR": os.path.join(os.getenv('HOME'), '.config'),
"CACHE_DIR": os.path.join(os.getenv('HOME'), '.cache')
}
def noop():
pass
@ -359,9 +370,6 @@ class WebEngine(WebKit2.WebView):
case 'isdir': case 'isdir':
output = os.path.isdir(filepath) output = os.path.isdir(filepath)
case 'mkdir':
output = os.makedirs(filepath)
return (_error, output) return (_error, output)

View File

@ -103,15 +103,6 @@ function _postMessage(data = {}, uuid = null) {
window.dispatchEvent(ev) window.dispatchEvent(ev)
} }
function readonly(obj, key, value) {
Object.defineProperty(obj, key, {
get() {
return value
},
enumerable: false
})
}
class NativeImage { class NativeImage {
#origin #origin
@ -212,7 +203,7 @@ class EventEmitter {
} }
} }
readonly(window, 'native', new EventEmitter()) window.native = new EventEmitter()
native.$on('opener_message', (data, uuid) => _postMessage(data, uuid)) native.$on('opener_message', (data, uuid) => _postMessage(data, uuid))
@ -226,9 +217,6 @@ Object.assign(native, {
}, },
relaunch() { relaunch() {
return handler('app', { action: 'relaunch' }, NO_CALLBACK) return handler('app', { action: 'relaunch' }, NO_CALLBACK)
},
getLocale() {
return native.env.LANG
} }
}, },
fs: { fs: {
@ -277,9 +265,6 @@ Object.assign(native, {
}, },
copy(filepath, target) { copy(filepath, target) {
return handler('fs', { action: 'copy', filepath, target }) return handler('fs', { action: 'copy', filepath, target })
},
mkdir(filepath) {
return handler('fs', { action: 'mkdir', filepath })
} }
}, },
image(filepath) { image(filepath) {