Esempio n. 1
0
 def _extract(self, jarpath):
   self.context.log.debug('Extracting idl jar to: %s' % self._EXTRACT_BASE)
   ZIP.extract(jarpath, self._EXTRACT_BASE)
   with open_zip(jarpath) as jar:
     sources = filter(lambda path: path.endswith('.thrift'), jar.namelist())
     self.context.log.debug('Found thrift IDL sources: %s' % sources)
     return sources
Esempio n. 2
0
 def _extract(self, jarpath):
     self.context.log.debug('Extracting idl jar to: %s' %
                            self._EXTRACT_BASE)
     ZIP.extract(jarpath, self._EXTRACT_BASE)
     with open_zip(jarpath) as jar:
         sources = filter(lambda path: path.endswith('.thrift'),
                          jar.namelist())
         self.context.log.debug('Found thrift IDL sources: %s' % sources)
         return sources
Esempio n. 3
0
  def dump(self, jarpath, jarfile):
    self.context.log.debug('  dumping %s' % jarpath)

    with temporary_dir() as tmpdir:
      ZIP.extract(jarpath, tmpdir)
      for root, dirs, files in os.walk(tmpdir):
        for file in files:
          path = os.path.join(root, file)
          relpath = os.path.relpath(path, tmpdir)
          if Manifest.PATH != relpath:
            jarfile.write(path, relpath)
Esempio n. 4
0
    def dump(self, jarpath, jarfile):
        self.context.log.debug('  dumping %s' % jarpath)

        with temporary_dir() as tmpdir:
            ZIP.extract(jarpath, tmpdir)
            for root, dirs, files in os.walk(tmpdir):
                for file in files:
                    path = os.path.join(root, file)
                    relpath = os.path.relpath(path, tmpdir)
                    if Manifest.PATH != relpath:
                        jarfile.write(path, relpath)
Esempio n. 5
0
  def dump(self, jarpath, jarfile):
    self.context.log.debug('  dumping %s' % jarpath)

    with temporary_dir() as tmpdir:
      try:
        ZIP.extract(jarpath, tmpdir)
      except zipfile.BadZipfile:
        raise TaskError('Bad JAR file, maybe empty: %s' % jarpath)
      for root, dirs, files in os.walk(tmpdir):
        for f in files:
          path = os.path.join(root, f)
          relpath = os.path.relpath(path, tmpdir)
          if Manifest.PATH != relpath:
            jarfile.write(path, relpath)
Esempio n. 6
0
    def dump(self, jarpath, jarfile):
        self.context.log.debug('  dumping %s' % jarpath)

        with temporary_dir() as tmpdir:
            try:
                ZIP.extract(jarpath, tmpdir)
            except zipfile.BadZipfile:
                raise TaskError('Bad JAR file, maybe empty: %s' % jarpath)
            for root, dirs, files in os.walk(tmpdir):
                for f in files:
                    path = os.path.join(root, f)
                    relpath = os.path.relpath(path, tmpdir)
                    if Manifest.PATH != relpath:
                        jarfile.write(path, relpath)