convert file object in filelist object
authorAlexandr Popov <popov2al@gmail.com>
Tue, 10 Mar 2009 18:20:23 +0000 (21:20 +0300)
committerAlexandr Popov <popov2al@gmail.com>
Tue, 10 Mar 2009 18:20:23 +0000 (21:20 +0300)
src/file.py [deleted file]
src/filelist.py [new file with mode: 0644]

diff --git a/src/file.py b/src/file.py
deleted file mode 100644 (file)
index 94a7746..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python
-# -*-coding: utf-8 -*-
-# vim: sw=4 ts=4 expandtab ai
-# pylint: disable-msg=C0301
-
-class File(object):
-    def add(self, fpath, fsize):
-        self.fl_path = fpath
-        self.fl_size = fsize
-    
-    def show(self):
-        self.cur_ui.show(self.fl_path, self.fl_size)
-        
-    def __init__(self, ui):
-        if ui is 'console':
-            from consprint import ConsPrint
-            self.cur_ui = ConsPrint()
-        self.fl_path = None
-        self.fl_size = None
diff --git a/src/filelist.py b/src/filelist.py
new file mode 100644 (file)
index 0000000..8d8b999
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+# -*-coding: utf-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+# pylint: disable-msg=C0301
+
+class FileList(object):
+    def add(self, fpath, fsize):
+        self.flist.append((fpath, fsize))
+    
+    def show(self):
+        for fpath, fsize in self.flist:
+            self.ui.show(fpath, fsize)
+        
+    def __init__(self, out_ui):
+        self.ui = out_ui
+        self.flist = []