# Path: grace/error.py
# class NoExectuableError(Error):
#     pass
# 
# class FolderNotFoundError(Error):
#     pass
# 
# Path: grace/utils.py
# def update(d, u):
#     for k, v in u.items():
#         if isinstance(v, collections.Mapping):
#             r = update(d.get(k, {}), v)
#             d[k] = r
#         else:
#             d[k] = u[k]
#     return d
# 
# def write_json(string):
#     try:
#         return json.dumps(string)
#     except:
#         raise


from builtins import object
from .error import NoExectuableError, FolderNotFoundError
from tempfile import NamedTemporaryFile
from .utils import update, write_json
import os
import sys
import subprocess
import copy
import collections
import requests
import time
/*
if (data.unused && data.unused.length > 0) {
    process.stdout.write('Unused\n------\n')
    for (index in data.unused) {
        unused = data.unused[index]
        process.stdout.write('Unused \'' + unused.name + '\' on line ' + unused.line + ' character ' + unused.character + '\n');
    };
} else {
    //process.stdout.write('No unused found.')
}
*/

if (data.errors) {
    process.exit(1);
} else {
    process.exit(0);
}
"""

        self._jslint_node_script = r"""
var jslint = require("%s").jslint;
var readFileSync = require("fs").readFileSync;
var warnings = null;
var i = 0;
var lint = null;
var src = null;
var options = null;

process.stdout.write("Analyzing file " + process.argv[2] + "\n");
src = readFileSync(process.argv[2], "utf8");

# Path: grace/error.py
# class NoExectuableError(Error):
#     pass
# 
# class FolderNotFoundError(Error):
#     pass
# 
# Path: grace/utils.py
# def update(d, u):
#     for k, v in u.items():
#         if isinstance(v, collections.Mapping):
#             r = update(d.get(k, {}), v)
#             d[k] = r
#         else:
#             d[k] = u[k]
#     return d
# 
# def write_json(string):
#     try:
#         return json.dumps(string)
#     except:
#         raise


# Path: grace/lint.py
from builtins import object
from .error import NoExectuableError, FolderNotFoundError
from tempfile import NamedTemporaryFile
from .utils import update, write_json
import os
import sys
import subprocess
import copy
import collections
import requests
import time

/*
if (data.unused && data.unused.length > 0) {
    process.stdout.write('Unused\n------\n')
    for (index in data.unused) {
        unused = data.unused[index]
        process.stdout.write('Unused \'' + unused.name + '\' on line ' + unused.line + ' character ' + unused.character + '\n');
    };
} else {
    //process.stdout.write('No unused found.')
}
*/

if (data.errors) {
    process.exit(1);
} else {
    process.exit(0);
}
"""

        self._jslint_node_script = r"""
var jslint = require("%s").jslint;
var readFileSync = require("fs").readFileSync;
var warnings = null;
var i = 0;
var lint = null;
var src = null;
var options = null;

process.stdout.write("Analyzing file " + process.argv[2] + "\n");
src = readFileSync(process.argv[2], "utf8");

options = '%s';