source: cowsclient/trunk/cowsclient/scripts/jslint_check_js_files.py @ 6119

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cowsclient/trunk/cowsclient/scripts/jslint_check_js_files.py@6119
Revision 6119, 684 bytes checked in by pnorton, 10 years ago (diff)

Made several changes to try and reduce the amount of data to download on the wmsviz page. Also created a single place where the js files for the wmsviz page are listed.

Line 
1'''
2Created on 20 Nov 2009
3
4@author: pnorton
5'''
6import os
7import pkg_resources
8
9JS_LINT_COMMAND = './jslint'
10
11def jsLintCheckFiles(files):
12   
13    jsDir = os.path.join(pkg_resources.resource_filename('cowsclient',''), 'public/js')
14   
15    for f in files:
16        filePath = os.path.join(jsDir,f)
17       
18       
19        cmd = 'jslint %s' % (filePath)
20        ret = os.system(cmd)
21       
22        if ret != 0:
23            print "Error(s) found in file %s" % filePath
24            break
25   
26
27if __name__ == '__main__':
28    from cowsclient.lib.js_files_list import getJSFilesForPage
29    javascript_files = getJSFilesForPage('wmsviz')
30       
31    jsLintCheckFiles(javascript_files)
Note: See TracBrowser for help on using the repository browser.