remove trailing whitespace

This commit is contained in:
Jason Woofenden 2012-11-07 23:40:59 -05:00
parent e1edc8079f
commit 0b6709392b
104 changed files with 1479 additions and 1479 deletions

View file

@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var util = require('util');
var spawn = require('child_process').spawn;
var async = require("async");
@ -35,7 +35,7 @@ if(os.type().indexOf("Windows") > -1)
{
//span an abiword process to perform the conversion
var abiword = spawn(settings.abiword, ["--to=" + task.destFile, task.srcFile]);
//delegate the processing of stdout to another function
abiword.stdout.on('data', function (data)
{
@ -44,7 +44,7 @@ if(os.type().indexOf("Windows") > -1)
});
//append error messages to the buffer
abiword.stderr.on('data', function (data)
abiword.stderr.on('data', function (data)
{
stdoutBuffer += data.toString();
});
@ -64,7 +64,7 @@ if(os.type().indexOf("Windows") > -1)
callback();
});
}
exports.convertFile = function(srcFile, destFile, type, callback)
{
doConvertTask({"srcFile": srcFile, "destFile": destFile, "type": type}, callback);
@ -80,16 +80,16 @@ else
var spawnAbiword = function (){
abiword = spawn(settings.abiword, ["--plugin", "AbiCommand"]);
var stdoutBuffer = "";
var firstPrompt = true;
var firstPrompt = true;
//append error messages to the buffer
abiword.stderr.on('data', function (data)
abiword.stderr.on('data', function (data)
{
stdoutBuffer += data.toString();
});
//abiword died, let's restart abiword and return an error with the callback
abiword.on('exit', function (code)
abiword.on('exit', function (code)
{
spawnAbiword();
stdoutCallback("Abiword died with exit code " + code);
@ -100,16 +100,16 @@ else
{
//add data to buffer
stdoutBuffer+=data.toString();
//we're searching for the prompt, cause this means everything we need is in the buffer
if(stdoutBuffer.search("AbiWord:>") != -1)
{
//filter the feedback message
var err = stdoutBuffer.search("OK") != -1 ? null : stdoutBuffer;
//reset the buffer
stdoutBuffer = "";
//call the callback with the error message
//skip the first prompt
if(stdoutCallback != null && !firstPrompt)
@ -117,7 +117,7 @@ else
stdoutCallback(err);
stdoutCallback = null;
}
firstPrompt = false;
}
});
@ -127,7 +127,7 @@ else
doConvertTask = function(task, callback)
{
abiword.stdin.write("convert " + task.srcFile + " " + task.destFile + " " + task.type + "\n");
//create a callback that calls the task callback and the caller callback
stdoutCallback = function (err)
{
@ -136,12 +136,12 @@ else
task.callback(err);
};
}
//Queue with the converts we have to do
var queue = async.queue(doConvertTask, 1);
exports.convertFile = function(srcFile, destFile, type, callback)
{
{
queue.push({"srcFile": srcFile, "destFile": destFile, "type": type, "callback": callback});
};
}