]> err.no Git - dak/commitdiff
daklib/command.py: Add another experimental action.
authorAnsgar Burchardt <ansgar@debian.org>
Wed, 19 Sep 2012 16:05:56 +0000 (18:05 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Wed, 19 Sep 2012 16:05:56 +0000 (18:05 +0200)
daklib/command.py

index 74d205680148d783fddcd6f65fc7aac0470321e4..639611c2a7ee5c1cbc82c09b94279beee0319483 100644 (file)
@@ -72,6 +72,8 @@ class CommandFile(object):
 
             if action == 'dm':
                 self.action_dm(self.fingerprint, section, session)
+            elif action == 'break-the-archive':
+                self.action_break_the_archive(self.fingerprint, section, session)
             else:
                 raise CommandError('Unknown action: {0}'.format(action))
         except StopIteration:
@@ -222,3 +224,11 @@ class CommandFile(object):
             self.result.append('Denied: {0}'.format(source))
 
         session.commit()
+
+    def action_break_the_archive(self, fingerprint, section, session):
+        name = 'Dave'
+        uid = fingerprint.uid
+        if uid is not None and uid.name is not None:
+            name = uid.name.split()[0]
+
+        self.result.append("DAK9000: I'm sorry, {0}. I'm afraid I can't do that.".format(name))