Exemplo n.º 1
0
def _reload_rcfile():
    """Reload Pyful.environs["RCFILE"]"""
    try:
        path = Pyful.environs["RCFILE"]
        util.loadfile(path)
        message.puts("Reloaded: {0}".format(path))
    except Exception as e:
        message.exception(e)
Exemplo n.º 2
0
 def loadrcfile(self, path=None):
     if path is None:
         libpath = os.path.dirname(os.path.abspath(__file__))
         defpath = os.path.join(libpath, "rc.py")
         path = os.path.expanduser(self.environs["RCFILE"])
         if not os.path.exists(path):
             path = defpath
     try:
         util.loadfile(path)
         self.environs["RCFILE"] = path
     except Exception as e:
         util.loadfile(defpath)
         self.environs["RCFILE"] = defpath
         return e