Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@merlin.export
def main(self, plexus, argv):
"""
This is the action of the spell
"""
# check
try:
# whether this project is initialized
project = self.vfs['project']
# if it isn't
except self.vfs.NotFoundError:
# complain
return plexus.error.log("not a merlin project; did you forget to cast 'merlin init'?")
# get hold of my local filesystem
local = self.vfs['pyre/startup']
# dump it
# local.dump()
@merlin.export(tip='dump the application virtual filesystem')
def vfs(self, plexus, **kwds):
"""
Dump the application virtual filesystem
"""
# get the prefix
prefix = self.prefix or '/merlin'
# build the report
report = '\n'.join(plexus.vfs[prefix].dump())
# sign in
plexus.info.line('vfs: prefix={!r}'.format(prefix))
# dump
plexus.info.log(report)
# all done
return
@merlin.export(tip="print out the license and terms of use")
def license(self, plexus, **kwds):
"""
Print the license and terms of use of the merlin package
"""
# make some space
plexus.info.line()
# print the license
plexus.info.log(merlin.meta.license)
# all done
return
@merlin.export(tip='dump the application configuration namespace')
def nfs(self, plexus, **kwds):
"""
Dump the application configuration namespace
"""
# get the prefix
prefix = self.prefix or 'merlin'
# show me
plexus.pyre_nameserver.dump(prefix)
# all done
return
@merlin.export
def main(self, plexus, argv):
"""
Print the copyright note of the merlin package
"""
# invoke the package function
merlin.copyright()
# all done
return
@merlin.export(tip="print out the acknowledgments")
def credits(self, plexus, **kwds):
"""
Print the acknowledgments
"""
# make some space
plexus.info.line()
# print the acknowledgments
plexus.info.log(merlin.meta.acknowledgments)
# all done
return
@merlin.export(tip="print the version number")
def version(self, plexus, **kwds):
"""
Print the version of the merlin package
"""
# print the version number as simply as possible
print(merlin.meta.version)
# all done
return
@merlin.export
def main(self, plexus, argv):
"""
Print out the license and terms of use of the merlin package
"""
# invoke the package function
merlin.license()
# all done
return
@merlin.export
def main(self, plexus, argv):
"""
Print the version of the merlin package
"""
# invoke the package function
print(merlin._merlin_header)
# all done
return