removed excess code

This commit is contained in:
AJ ONeal 2010-11-29 00:50:13 -07:00
parent 8eebc915a2
commit c499bbc883
1 changed files with 5 additions and 26 deletions

View File

@ -79,24 +79,6 @@
return head; return head;
} }
function readFile(file) {
var promise = require('futures').promise(),
stream,
data = new Buffer('');
stream = fs.createReadStream(file, { flags: 'r', encoding: 'utf8' });
stream.on('error', function (err) {
promise.fulfill(err, stream, data);
});
stream.on('data', function (chunk) {
data += chunk;
});
stream.on('end', function () {
promise.fulfill(undefined, stream, data);
});
return promise;
}
// Queries // Queries
// Average height of Heads of Household // Average height of Heads of Household
@ -167,6 +149,10 @@
var data = ''; var data = '';
function parseData(err, x, chunk, end) { function parseData(err, x, chunk, end) {
if (err) {
usage();
throw err;
}
if (!end) { if (!end) {
data += chunk.toString(); data += chunk.toString();
return; return;
@ -192,14 +178,7 @@
return; return;
} }
request.get(fulluri, undefined, { stream: true}).when(parseData); request.get(fulluri, undefined, { stream: true }).when(parseData);
//if ('file' !== uri.protocol && '' === uri.protocol || uri.protocol.match(/^http[s]?:$/)) {
// request.get(fulluri, undefined, { stream: true}).when(parseData);
//} else {
// usage();
// return;
//}
} }
main(); main();