Exemple #1
0
 def execute(self, callinfo):
     args = callinfo.args
     if len(args) == 0:
         return
     s = ""
     if args[0].startswith("/"):
         path = args[0]
     else:
         d = os.path.dirname(self.state.filename)
         path = os.path.join(d, args[0])
     log("path", path)
     s += '.do tenorsax filename "' + path + '"\n'
     with open(path) as fp:
         s += "".join(fp.readlines())
     s += '.do tenorsax filename "' + self.state.filename + '"\n'
     return (s, None)
Exemple #2
0
 def execute(self, callinfo):
     args = callinfo.args
     if len(args) == 0:
         return
     for md in self.state.macrodirs:
         for suffix in ("", ".tmac"):
             path = os.path.expanduser(md + "/" + args[0] + suffix)
             log("path", path)
             s = ""
             try:
                 s += '.do tenorsax filename "' + path + '"\n'
                 with open(path) as fp:
                     s += "".join(fp.readlines())
                 s += '.do tenorsax filename "' + self.state.filename + '"\n'
                 log("path successful")
                 return (s, None)
             except:
                 pass
     return ("", None)