mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-29 06:52:25 +01:00
Merge branch 'master' into vimperator-2.1
Conflicts: common/content/io.js
This commit is contained in:
@@ -68,7 +68,7 @@ function IO() //{{{
|
||||
|
||||
const downloadManager = Cc["@mozilla.org/download-manager;1"].createInstance(Ci.nsIDownloadManager);
|
||||
|
||||
var processDir = service["directory"].get("CurWorkD", Ci.nsIFile);
|
||||
var processDir = services.get("directory").get("CurWorkD", Ci.nsIFile);
|
||||
var cwd = processDir;
|
||||
var oldcwd = null;
|
||||
|
||||
@@ -76,7 +76,7 @@ function IO() //{{{
|
||||
var scriptNames = [];
|
||||
|
||||
// default option values
|
||||
var cdpath = "," + (service["environment"].get("CDPATH").replace(/[:;]/g, ",") || ",");
|
||||
var cdpath = "," + (services.get("environment").get("CDPATH").replace(/[:;]/g, ",") || ",");
|
||||
var shell, shellcmdflag;
|
||||
|
||||
if (WINDOWS)
|
||||
@@ -88,7 +88,7 @@ function IO() //{{{
|
||||
}
|
||||
else
|
||||
{
|
||||
shell = service["environment"].get("SHELL") || "sh";
|
||||
shell = services.get("environment").get("SHELL") || "sh";
|
||||
shellcmdflag = "-c";
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ function IO() //{{{
|
||||
{
|
||||
try
|
||||
{
|
||||
service.getFile().initWithPath(path);
|
||||
services.create("file").initWithPath(path);
|
||||
return true;
|
||||
}
|
||||
catch (e)
|
||||
@@ -473,7 +473,7 @@ function IO() //{{{
|
||||
// also expands relative paths
|
||||
getFile: function (path, noCheckPWD)
|
||||
{
|
||||
let file = service.getFile();
|
||||
let file = services.create("file");
|
||||
|
||||
if (/file:\/\//.test(path))
|
||||
{
|
||||
@@ -514,7 +514,7 @@ function IO() //{{{
|
||||
break;
|
||||
}
|
||||
|
||||
let file = service["directory"].get("TmpD", Ci.nsIFile);
|
||||
let file = services.get("directory").get("TmpD", Ci.nsIFile);
|
||||
file.append(tmpName);
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600);
|
||||
|
||||
@@ -620,7 +620,7 @@ function IO() //{{{
|
||||
}
|
||||
else
|
||||
{
|
||||
let dirs = service["environment"].get("PATH").split(WINDOWS ? ";" : ":");
|
||||
let dirs = services.get("environment").get("PATH").split(WINDOWS ? ";" : ":");
|
||||
// Windows tries the cwd first TODO: desirable?
|
||||
if (WINDOWS)
|
||||
dirs = [io.getCurrentDirectory().path].concat(dirs);
|
||||
@@ -638,7 +638,7 @@ lookup:
|
||||
// automatically try to add the executable path extensions on windows
|
||||
if (WINDOWS)
|
||||
{
|
||||
let extensions = service["environment"].get("PATHEXT").split(";");
|
||||
let extensions = services.get("environment").get("PATHEXT").split(";");
|
||||
for (let [,extension] in Iterator(extensions))
|
||||
{
|
||||
file = joinPaths(dir, program + extension);
|
||||
@@ -657,7 +657,7 @@ lookup:
|
||||
return -1;
|
||||
}
|
||||
|
||||
let process = service.getProcess();
|
||||
let process = services.create("process");
|
||||
|
||||
process.init(file);
|
||||
process.run(blocking, args, args.length);
|
||||
@@ -771,7 +771,7 @@ lookup:
|
||||
liberator.echomsg("sourcing " + filename.quote(), 2);
|
||||
|
||||
let str = ioManager.readFile(file);
|
||||
let uri = service["io"].newFileURI(file);
|
||||
let uri = ioService.newFileURI(file);
|
||||
|
||||
// handle pure javascript files specially
|
||||
if (/\.js$/.test(filename))
|
||||
@@ -863,7 +863,7 @@ lookup:
|
||||
else
|
||||
{
|
||||
// execute a normal liberator command
|
||||
liberator.execute(line);
|
||||
liberator.execute(line, null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -936,20 +936,20 @@ IO.expandPath = function (path, relative)
|
||||
function expand(path) path.replace(
|
||||
!WINDOWS ? /\$(\w+)\b|\${(\w+)}/g
|
||||
: /\$(\w+)\b|\${(\w+)}|%(\w+)%/g,
|
||||
function (m, n1, n2, n3) service["environment"].get(n1 || n2 || n3) || m
|
||||
function (m, n1, n2, n3) services.get("environment").get(n1 || n2 || n3) || m
|
||||
);
|
||||
path = expand(path);
|
||||
|
||||
// expand ~
|
||||
if (!relative && (WINDOWS ? /^~(?:$|\\)/ : /^~(?:$|\/)/).test(path))
|
||||
if (!relative && (WINDOWS ? /^~(?:$|[\\\/])/ : /^~(?:$|\/)/).test(path))
|
||||
{
|
||||
// Try $HOME first, on all systems
|
||||
let home = service["environment"].get("HOME");
|
||||
let home = services.get("environment").get("HOME");
|
||||
|
||||
// Windows has its own ideosyncratic $HOME variables.
|
||||
if (!home && WINDOWS)
|
||||
home = service["environment"].get("USERPROFILE") ||
|
||||
service["environment"].get("HOMEDRIVE") + service["environment"].get("HOMEPATH");
|
||||
home = services.get("environment").get("USERPROFILE") ||
|
||||
services.get("environment").get("HOMEDRIVE") + services.get("environment").get("HOMEPATH");
|
||||
|
||||
path = home + path.substr(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user