def run(debug=None, type=None, category=None, filename=None): if debug: import mcstas2 mcstas2.DEBUG = True if filename: compileFile(filename, category) return from mcvine import findcomponentfactory cf = findcomponentfactory( type=type, category=category or None, supplier='mcstas2', ) # instantiate a component will trigger automatic build procedure cf() return
def main(self, *args, **kwds): filename = self.filename import os if filename and not os.path.exists(filename): self.help() print print "** Error: file %s does not exist" % filename return if filename: self.compileFile(filename) return from mcvine import findcomponentfactory cf = findcomponentfactory( type=self.type, category=self.category or None, supplier='mcstas2', ) # instantiate a component will trigger automatic build procedure cf() return
def compilecomponent(debug=None, type=None, category=None, filename=None): if debug: import mcstas2 mcstas2.DEBUG = True if filename: if not os.path.exists(filename): raise IOError("File %r does not exist" % filename) click.echo("Compiling %s..." % filename) compileFile(filename, category) return if not category and not type: raise RuntimeError("neither category nor type nor component paths was given") from mcvine import findcomponentfactory click.echo("Compiling component %s in category %r ..." % ( type, category)) cf = findcomponentfactory( type=type, category=category or None, supplier='mcstas2', ) # instantiate a component will trigger automatic build procedure cf() return