mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Build process checking for coffeescript
This commit is contained in:
parent
300e9e1f99
commit
c9601ae83b
@ -63,11 +63,14 @@ class Check(Command):
|
||||
for f in x[-1]:
|
||||
y = self.j(x[0], f)
|
||||
mtime = os.stat(y).st_mtime
|
||||
if (f.endswith('.py') and f not in ('ptempfile.py', 'feedparser.py',
|
||||
if cache.get(y, 0) == mtime:
|
||||
continue
|
||||
if (f.endswith('.py') and f not in ('feedparser.py',
|
||||
'pyparsing.py', 'markdown.py') and
|
||||
'genshi' not in y and cache.get(y, 0) != mtime and
|
||||
'prs500/driver.py' not in y):
|
||||
yield y, mtime
|
||||
if f.endswith('.coffee'):
|
||||
yield y, mtime
|
||||
|
||||
for x in os.walk(self.j(self.d(self.SRC), 'recipes')):
|
||||
for f in x[-1]:
|
||||
@ -84,9 +87,20 @@ class Check(Command):
|
||||
builtins = list(set_builtins(self.BUILTINS))
|
||||
for f, mtime in self.get_files(cache):
|
||||
self.info('\tChecking', f)
|
||||
errors = False
|
||||
ext = os.path.splitext(f)[1]
|
||||
if ext in {'.py', '.recipe'}:
|
||||
w = check_for_python_errors(open(f, 'rb').read(), f)
|
||||
if w:
|
||||
errors = True
|
||||
self.report_errors(w)
|
||||
else:
|
||||
try:
|
||||
subprocess.check_call(['coffee', '-c', '-p', f],
|
||||
stdout=open(os.devnull, 'wb'))
|
||||
except:
|
||||
errors = True
|
||||
if errors:
|
||||
cPickle.dump(cache, open(self.CACHE, 'wb'), -1)
|
||||
subprocess.call(['gvim', '-f', f])
|
||||
raise SystemExit(1)
|
||||
|
@ -133,7 +133,15 @@ find_offset_for_point = (x, y, node, cdoc) ->
|
||||
class CanonicalFragmentIdentifier
|
||||
|
||||
# This class is a namespace to expose CFI functions via the window.cfi
|
||||
# object
|
||||
# object. The three most important functions are:
|
||||
#
|
||||
# is_compatible(): Throws an error if the browser is not compatible with
|
||||
# this script
|
||||
#
|
||||
# at(x, y): which maps a point to a CFI, if possible
|
||||
#
|
||||
# scroll_to(cfi): which scrolls the browser to a point corresponding to the
|
||||
# given cfi, and returns the x and y co-ordinates of the point.
|
||||
|
||||
constructor: () -> # {{{
|
||||
this.CREATE_RANGE_ERR = "Your browser does not support the createRange function. Update it to a newer version."
|
||||
|
@ -5,7 +5,10 @@
|
||||
<script type="text/javascript" src="cfi.coffee"></script>
|
||||
<script type="text/javascript" src="cfi-test.coffee"></script>
|
||||
<style type="text/css">
|
||||
body { font-family: sans-serif }
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
h2 {
|
||||
border-top: solid 2px black;
|
||||
|
Loading…
x
Reference in New Issue
Block a user