changeset 7321:e016b65fd284

patchbomb: move exportee class to top level As suggested by djc.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Fri, 07 Nov 2008 10:18:12 +0100
parents 8dca507e56ce
children b05834d6be3c
files hgext/patchbomb.py
diffstat 1 files changed, 13 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Fri Nov 07 10:27:39 2008 +0100
+++ b/hgext/patchbomb.py	Fri Nov 07 10:18:12 2008 +0100
@@ -68,6 +68,19 @@
 from mercurial.i18n import _
 from mercurial.node import bin
 
+class exportee:
+    def __init__(self, container):
+        self.lines = []
+        self.container = container
+        self.name = 'email'
+
+    def write(self, data):
+        self.lines.append(data)
+
+    def close(self):
+        self.container.append(''.join(self.lines).split('\n'))
+        self.lines = []
+
 def patchbomb(ui, repo, *revs, **opts):
     '''send changesets by email
 
@@ -287,20 +300,6 @@
 
     def getexportmsgs():
         patches = []
-
-        class exportee:
-            def __init__(self, container):
-                self.lines = []
-                self.container = container
-                self.name = 'email'
-
-            def write(self, data):
-                self.lines.append(data)
-
-            def close(self):
-                self.container.append(''.join(self.lines).split('\n'))
-                self.lines = []
-
         commands.export(ui, repo, *revs, **{'output': exportee(patches),
                                             'switch_parent': False,
                                             'text': None,