def getGaeLibs(): from ale.core import isCommandInstalled if isCommandInstalled('gae'): return [os.path.join(alePath('recipes_installed/gae/pkgs/google_appengine_1.3.1/google_appengine/'), d) for d in ('.', 'lib/django', 'lib/webob', 'lib/yaml/lib', 'lib/antlr3')] if os.path.exists('/usr/local/google_appine'): return [os.path.join('/usr/local/google_appine', d) for d in ('.', 'lib/django', 'lib/webob', 'lib/yaml/lib', 'lib/antlr3')] return []
def addWatch(self, fileextension, command): self.loadWatches() if not isCommandInstalled(command): logging.error('unrecognized command: %s' % command) return commandsfortype = self.watchlist[fileextension] if fileextension in self.watchlist else None if commandsfortype: self.watchlist[fileextension].append(command) else: self.watchlist[fileextension] = [command] file = open(self.watchconfigfile, 'wb') pickle.dump(self.watchlist, file) file.close() logging.info('Added watch for .%s -- execute %s on change.' % (fileextension, command))
def install(self, args=None): if isCommandInstalled('pyflakes'): self.addWatch('py', 'pyflakes') if isCommandInstalled('test'): self.addWatch('py', 'test')