WIP - Remove ShellJS gir

You can define a new importer object by importing a subdirectory in GJS.
This is undocumented, but it is likely to at least hold until the whole
thing moves to ES6 modules.
This commit is contained in:
Philip Chimento
2016-10-04 22:27:18 -07:00
parent 8c49267658
commit a1e41b6519
6 changed files with 8 additions and 161 deletions

View File

@@ -6,9 +6,7 @@
const Lang = imports.lang;
const Signals = imports.signals;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const ShellJS = imports.gi.ShellJS;
const Config = imports.misc.config;
const FileUtils = imports.misc.fileUtils;
@@ -140,12 +138,11 @@ function createExtensionObject(uuid, dir, type) {
return extension;
}
var _extension = null;
function installImporter(extension) {
_extension = extension;
ShellJS.add_extension_importer('imports.misc.extensionUtils._extension', 'imports', extension.path);
_extension = null;
let oldSearchPath = imports.searchPath.slice(); // make a copy
imports.searchPath = [extension.path];
extension.imports = imports['.']; // "subdir" creates a new importer object
imports.searchPath = oldSearchPath;
}
const ExtensionFinder = new Lang.Class({