<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -19,7 +19,7 @@ class YakDump:
 		self.archiver = options.archiver if options.archiver else DEFAULTS['archiver']
 		self.archiver_options = options.archiver_options if options.archiver_options else DEFAULTS['archiver_options']
 		self.hostfile = options.hostfile if options.hostfile else DEFAULTS['hostfile']
-		self.user = options.user if options.user else DEFAULTS['user']
+		self.user = options.user if options.user else DEFAULTS['user'] # @todo: host/mysql/svn users should be split. Current implementation requires them all to be the same user which sucks. :(
 		self.dest_path = options.dest_path if options.dest_path else DEFAULTS['dest_path']
 
 		self.compress_ext = DEFAULTS['compress_ext'] #@todo: need this to check compress_app and pick based on that
@@ -28,8 +28,11 @@ class YakDump:
 	def get_hosts(self):
 		with open(self.hostfile) as f:
 			for line in f:
-				yield line
-	
+				yield line # sometimes even timeyak must yield to outside events.
+
+	def zip(self, file):
+		commands.getstatusoutput(self.compress_app + ' ' + file)
+
 	def dump(self, c, filename, noappend=False):
 		if not noappend:
 			self.files.append(filename)
@@ -48,15 +51,16 @@ class YakDump:
 	def dump_files(self, path):
 		filename = ''.join(path.split('/')) + self.time_str + self.archiver_ext
 		c = self.archiver + ' ' + self.archiver_options + ' ' + filename + ' ' + path
-		zip_c = self.compress_app + ' ' + filename
-		self.dump(c, filename, True)
-		self.dump(zip_c, filename)
+		self.dump(c, filename)
+	
+	def distribute(self,file):
+		self.zip(file)
+		for host in self.get_hosts():
+			c = 'scp ' + file + self.compress_ext + ' ' + self.user + '@' + host + ':' + self.dest_path # @todo: make this use whatever cp program you want and make the default rsync.
+			ret = commands.getstatusoutput(c.replace(&quot;\n&quot;, &quot;&quot;))
 
 	def copy_files(self):
-		for file in self.files:
-			for host in self.get_hosts():
-				c = 'scp ' + file + ' ' + self.user + '@' + host + ':' + self.dest_path
-				ret = commands.getstatusoutput(c.replace(&quot;\n&quot;, &quot;&quot;))
+		map(self.distribute, self.files)
 
 def parse_setup():
 	parser = OptionParser()</diff>
      <filename>timeyak.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e8e6e9db78e28a75db9e82f0a6d2e9a0f5b1de9d</id>
    </parent>
  </parents>
  <author>
    <name>Michael Matuzak</name>
    <email>michael@lambdaphant.com</email>
  </author>
  <url>http://github.com/emkay/timeyak/commit/878c05a7da42e4bac65a9b3b07d9ebbbcb71100c</url>
  <id>878c05a7da42e4bac65a9b3b07d9ebbbcb71100c</id>
  <committed-date>2009-05-08T11:43:00-07:00</committed-date>
  <authored-date>2009-05-08T11:43:00-07:00</authored-date>
  <message>abstracting out distribution of files and zipping of files. copy files now just maps through files on the stack and uses the distribute callback.</message>
  <tree>f1f3dfb8cd0cb484b86b762986e3999731f52e17</tree>
  <committer>
    <name>Michael Matuzak</name>
    <email>michael@lambdaphant.com</email>
  </committer>
</commit>
