comparison piecrust/processing/less.py @ 195:b4724e577a8c

cosmetic: Fix some PEP8 issues.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 11 Jan 2015 23:04:55 -0800
parents 0811f92cbdc7
children f82262f59600
comparison
equal deleted inserted replaced
194:5d8351cb32d8 195:b4724e577a8c
66 shell = (platform.system() == 'Windows') 66 shell = (platform.system() == 'Windows')
67 try: 67 try:
68 retcode = subprocess.call(args, shell=shell) 68 retcode = subprocess.call(args, shell=shell)
69 except FileNotFoundError as ex: 69 except FileNotFoundError as ex:
70 logger.error("Tried running LESS processor with command: %s" % 70 logger.error("Tried running LESS processor with command: %s" %
71 args) 71 args)
72 raise Exception("Error running LESS processor. " 72 raise Exception("Error running LESS processor. "
73 "Did you install it?") from ex 73 "Did you install it?") from ex
74 if retcode != 0: 74 if retcode != 0:
75 raise Exception("Error occured in LESS compiler. Please check " 75 raise Exception("Error occured in LESS compiler. Please check "
76 "log messages above for more information.") 76 "log messages above for more information.")
80 if self._conf is not None: 80 if self._conf is not None:
81 return 81 return
82 82
83 self._conf = self.app.config.get('less') or {} 83 self._conf = self.app.config.get('less') or {}
84 self._conf.setdefault('bin', 'lessc') 84 self._conf.setdefault('bin', 'lessc')
85 self._conf.setdefault('options', 85 self._conf.setdefault('options', ['--compress'])
86 ['--compress'])
87 if not isinstance(self._conf['options'], list): 86 if not isinstance(self._conf['options'], list):
88 raise Exception("The `less/options` configuration setting " 87 raise Exception("The `less/options` configuration setting "
89 "must be an array of arguments.") 88 "must be an array of arguments.")
90 89
91 def _getMapPath(self, path): 90 def _getMapPath(self, path):