Commits

Michał Górny  committed e64a29d

Support switching global flag modifiers via '+' and '-' actions.

  • Participants
  • Parent commits 61bd8a0

Comments (0)

Files changed (2)

File lib/flaggie/action.py

 
 	class enable(EffectiveEntryOp):
 		def __call__(self, pkgs, pfiles):
-			for p in pkgs:
+			for p in pkgs or (None,):
 				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 p in pkgs:
+			for p in pkgs or (None,):
 				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):

File lib/flaggie/makeconf.py

 			else:
 				raise NotImplementedError('Disable modified for MakeConfFlag is not supported.')
 
+		@property
+		def modifier(self):
+			return self._modifier
+
+		@modifier.setter
+		def modifier(self, val):
+			self._modifier = val
+			self.modified = True
+
 		def toString(self):
 			if not self.modified:
 				return self._origs