1. Michał Górny
  2. eclean-kernel

Commits

Michał Górny  committed 67c8a2f

Automatically generate part list for -l output.

  • Participants
  • Parent commits 51a8d52
  • Branches master

Comments (0)

Files changed (2)

File ecleankernel/cli.py

View file
  • Ignore whitespace
 	if opts.listkern:
 		for k in kernels:
 			print('%s:' % k.version)
-			for key in ('vmlinuz', 'systemmap', 'config', 'modules', 'build'):
+			for key in k.parts:
 				val = getattr(k, key)
 				if val is not None:
 					print('- %s: %s' % (key, val))

File ecleankernel/kernel.py

View file
  • Ignore whitespace
 	def build(self):
 		pass
 
+	@property
+	def parts(self):
+		for k in dir(self):
+			if not k.startswith('_') and isinstance(
+					getattr(self, k), PathRef):
+				yield k
+
 	def unrefall(self):
 		del self.vmlinuz
 		del self.systemmap