Added CLI version for files table output
authorEugene Gagarin <mosfet07@ya.ru>
Wed, 29 Apr 2009 06:43:00 +0000 (10:43 +0400)
committerEugene Gagarin <mosfet07@ya.ru>
Wed, 29 Apr 2009 06:43:00 +0000 (10:43 +0400)
src/files/outtable.py

index 7fc52ad..9585470 100755 (executable)
 #==============================================================================
 
 class Cli_Presentation(object):
-    pass
+    def __init__(self, filelist):   ###
+        self.toplevel = self.print_results(filelist)
+
+    def print_results(self, filelist):
+        for bsize, path, size in filelist:
+            print '%10d' % bsize, path
 
 #==============================================================================
 
@@ -40,10 +45,6 @@ class Gtk_Presentation(object):
 
         treeview = gtk.TreeView(self.liststore)
 
-        # На таблетке не отображаються заголовки столбцов по умолчанию -
-        # след строка заставляет их отображаться принудительно
-        treeview.set_headers_visible(1)
-
         # Создаем и настраиваем колонку с размером файла
         size_col = gtk.TreeViewColumn( 'Size')
         cell1 = gtk.CellRendererText()
@@ -75,3 +76,15 @@ class Gtk_Presentation(object):
 #         for path, size, bsize in filelist:
 #             print path, size, bsize
 #             self.liststore.append([path, size, bsize])
+
+#==============================================================================
+
+class Hildon_Presentation(object):
+    def __init__(self, filelist):   ###
+        import gtk
+        import gobject
+        import hildon
+
+        # На таблетке не отображаються заголовки столбцов по умолчанию -
+        # след строка заставляет их отображаться принудительно
+        treeview.set_headers_visible(1)