Пример #1
0
def use_xdr(dir, xdrfile):
    """Move to dir, and generate files based on xdr file"""
    os.chdir(dir)
    if needs_updating(xdrfile):
        xdrgen.run(xdrfile)
        for file in glob.glob(os.path.join(dir, 'parse*')):
            print("deleting", file)
            os.remove(file)
Пример #2
0
def use_xdr(dir, xdrfile):
    """Move to dir, and generate files based on xdr file"""
    os.chdir(dir)
    if needs_updating(xdrfile):
        xdrgen.run(xdrfile)
        for file in glob.glob(os.path.join(dir, 'parse*')):
            print("deleting", file)
            os.remove(file)
Пример #3
0
 def expand_xdr(self, dir):
     cwd = os.getcwd()
     try:
         if dir:
             os.chdir(dir)
         xdr_files = glob(os.path.join(dir, "*.x"))
         for f in xdr_files:
             # Can conditionalize this
             # XXX need some way to pass options here
             xdrgen.run(f)
     finally:
         os.chdir(cwd)
Пример #4
0
 def expand_xdr(self, dir):
   cwd = os.getcwd()
   try:
     if dir:
       os.chdir(dir)
     xdr_files = glob(os.path.join(dir, "*.x"))
     for f in xdr_files:
       # Can conditionalize this
       # XXX need some way to pass options here
       xdrgen.run(f)
   finally:
     os.chdir(cwd)
Пример #5
0
 def expand_xdr(self, dir):
     cwd = os.getcwd()
     try:
         if dir:
             os.chdir(dir)
         xdr_files = glob(os.path.join(dir, "*.x"))
         for f in xdr_files:
             # Can conditionalize this
             # XXX need some way to pass options here
             xdrgen.run(f)
             try:
                 os.remove("parser.out")
                 os.remove("parsetab.py")
             except:
                 print "Remove parse* failed"
     finally:
         os.chdir(cwd)
Пример #6
0
 def expand_xdr(self, dir):
     cwd = os.getcwd()
     try:
         if dir:
             os.chdir(dir)
         xdr_files = glob(os.path.join(dir, "*.x"))
         for f in xdr_files:
             # Can conditionalize this
             # XXX need some way to pass options here
             xdrgen.run(f)
             try:
                 os.remove("parser.out")
                 os.remove("parsetab.py")
             except:
                 print "Remove parse* failed"
     finally:
         os.chdir(cwd)
Пример #7
0
 def expand_xdr(self, dir):
     print("expand = %r" % dir)
     cwd = os.getcwd()
     xdrdir = os.path.join(cwd, dir, 'xdrdef')
     print("xdrdir = %r" % xdrdir)
     if os.path.exists(xdrdir):
         try:
             os.chdir(xdrdir)
             xdr_files = glob(os.path.join(xdrdir, "*.x"))
             for f in xdr_files:
                 # Can conditionalize this
                 # XXX need some way to pass options here
                 xdrgen.run(f)
                 try:
                     os.remove("parser.out")
                     os.remove("parsetab.py")
                 except:
                     print("Remove parse* failed")
         finally:
             os.chdir(cwd)