Esempio n. 1
0
 def __init__(self,
              filepath,
              fileobj=None,
              parent_path='',
              parent_sha512=None):
     AbstractFile.__init__(self, filepath, fileobj, parent_path,
                           parent_sha512)
Esempio n. 2
0
 def __init__(self,
              filepath,
              fileobj=None,
              parent_path='',
              parent_sha512=None):
     AbstractFile.__init__(self, filepath, fileobj, parent_path,
                           parent_sha512)
     assert self.type in handled_signers
     self.signature = decode_signer(self.filepath)
Esempio n. 3
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		arg = fileobj if fileobj else filepath
		if not is_archive(arg):
			# Oops, this was not really an archive
			raise ValueError
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)
		self.archive = make_archive_obj(filepath, fileobj, True)
Esempio n. 4
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		if not fileobj:
			path = join(parent_path, filepath)
			fileobj = open(path, 'rb')
		fileobj.seek(0)
		# Skip java compiler version.
		self.magic = read_magic(fileobj)
		self.version = read_version(fileobj)
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)
Esempio n. 5
0
 def __init__(self,
              filepath,
              fileobj=None,
              parent_path='',
              parent_sha512=None):
     if not fileobj:
         path = join(parent_path, filepath)
         fileobj = open(path, 'rb')
     fileobj.seek(0)
     # Skip java compiler version.
     self.magic = read_magic(fileobj)
     self.version = read_version(fileobj)
     AbstractFile.__init__(self, filepath, fileobj, parent_path,
                           parent_sha512)
Esempio n. 6
0
    def info(self):
        """Returns the information related to this file, this includes those
		provided by pyrus.file.AbstractFile.info() and info extracted
		from the binary class file."""
        fileinfo = AbstractFile.info(self)
        fileinfo['magic'] = self.magic
        fileinfo['version-string'] = major_version(self.version[0])
        fileinfo['version'] = self.version
        return fileinfo
Esempio n. 7
0
	def info(self):
		"""Returns the information related to this file, this includes those
		provided by pyrus.file.AbstractFile.info() and info extracted
		from the binary class file."""
		fileinfo = AbstractFile.info(self)
		fileinfo['magic'] = self.magic
		fileinfo['version-string'] = major_version(self.version[0])
		fileinfo['version'] = self.version
		return fileinfo
Esempio n. 8
0
 def info(self):
     fileinfo = AbstractFile.info(self)
     fileinfo['signature'] = self.signature
     return fileinfo
Esempio n. 9
0
	def info(self):
		"""Returns the information related to this file, this includes those
		provided by pyrus.file.AbstractFile.info() and the manifest headers."""
		fileinfo = AbstractFile.info(self)
		fileinfo['manifest-info'] = self.manifestinfo
		return fileinfo
Esempio n. 10
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)
		self.manifestinfo = {}
		self.parse()
Esempio n. 11
0
	def info(self):
		fileinfo = AbstractFile.info(self)
		fileinfo['signature'] = self.signature
		return fileinfo
Esempio n. 12
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)
		assert self.type in handled_signers
		self.signature = decode_signer(self.filepath)
Esempio n. 13
0
	def __init__(self, filepath, fileobj=None, parent_path='',
				parent_sha512=None):
		AbstractFile.__init__(self, filepath, fileobj, parent_path,
							parent_sha512)