Commits

Michał Górny committed 19011b7

Raise NotImplementedError on global actions directly in actions.

  • Participants
  • Parent commits fa80d6b

Comments (0)

Files changed (1)

File lib/flaggie/action.py

 				for ns, arg in self.expand_patterns(self.args, p):
 					f = self.grab_effective_entry(p, arg, pfiles[ns], rw = True)
 					f.modifier = ''
+			if not pkgs:
+				raise NotImplementedError('Global actions are not supported yet.')
 
 	class disable(EffectiveEntryOp):
 		def __call__(self, pkgs, pfiles):
 				for ns, arg in self.expand_patterns(self.args, p):
 					f = self.grab_effective_entry(p, arg, pfiles[ns], rw = True)
 					f.modifier = '-'
+			if not pkgs:
+				raise NotImplementedError('Global actions are not supported yet.')
 
 	class reset(BaseAction):
 		def __call__(self, pkgs, pfiles):
 					for pe in puse[p]:
 						for f in self.args:
 							del pe[f]
+				if not pkgs:
+					raise NotImplementedError('Global actions are not supported yet.')
 
 	class output(BaseAction):
 		def __call__(self, pkgs, pfiles):
 						l.append(flags[fn].toString() if flags[fn] is not None else '?%s' % fn)
 
 					print(' '.join(l))
+				if not pkgs:
+					raise NotImplementedError('Global actions are not supported yet.')
 
 	mapping = {
 		'+': enable,
 
 	def __call__(self, pfiles):
 		self.sort()
-		if self.pkgs:
-			for a in self:
-				a(self.pkgs, pfiles)
-		else:
-			raise NotImplementedError('Global actions are not supported yet, they will be ignored.')
+		for a in self:
+			a(self.pkgs, pfiles)