Commits

Michał Górny committed 67c8a2f

Automatically generate part list for -l output.

Comments (0)

Files changed (2)

ecleankernel/cli.py

 	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))

ecleankernel/kernel.py

 	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