import string
import sys
import time
+import subprocess
COMMENT = 'COMMENT'
STRING = 'STRING'
CXX = 'C++'
verbose_p = 0
indent_p = 1
+REQUIRED_ASTYLE_VERSION = "Artistic Style Version 2.02"
+
rules = {
GLOBAL_CXX:
sys.exit (2)
return files
+def check_astyle_version():
+ cmd = "astyle --version"
+ process = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE)
+ stdout, stderr = process.communicate()
+ if REQUIRED_ASTYLE_VERSION in stderr:
+ return True
+ return False
+
outdir = 0
format = CXX
socketname = 'fixcc%d' % os.getpid ()
def main ():
+ if not check_astyle_version():
+ print "Error: we require %s" % REQUIRED_ASTYLE_VERSION
+ print "Sorry, no higher (or lower) versions allowed"
+ sys.exit(1)
files = do_options ()
if outdir and not os.path.isdir (outdir):
os.makedirs (outdir)
typedef std::map < AFM_Ligature const *, int > Bar;
/**
- Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
/* ||