[Pkg-anonymity-tools] [onionshare] 45/140: sort the list of filenames being shared

Ulrike Uhlig u-guest at moszumanska.debian.org
Mon Sep 29 20:33:46 UTC 2014


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository onionshare.

commit 36914114f9481903b4f42fe2ac53cf9087e04da9
Author: Micah Lee <micah at micahflee.com>
Date:   Thu Aug 28 16:26:56 2014 -0700

    sort the list of filenames being shared
---
 onionshare/web.py                | 2 ++
 onionshare_gui/file_selection.py | 1 +
 2 files changed, 3 insertions(+)

diff --git a/onionshare/web.py b/onionshare/web.py
index db5e7f5..f8449fd 100644
--- a/onionshare/web.py
+++ b/onionshare/web.py
@@ -27,6 +27,8 @@ def set_file_info(filenames):
             info['size'] = helpers.dir_size(filename)
             info['size_human'] = helpers.human_readable_filesize(info['size'])
             file_info['dirs'].append(info)
+    file_info['files'] = sorted(file_info['files'], key=lambda k: k['basename'])
+    file_info['dirs'] = sorted(file_info['dirs'], key=lambda k: k['basename'])
 
     # zip up the files and folders
     z = helpers.ZipWriter()
diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py
index 7898b3d..5b7c8b8 100644
--- a/onionshare_gui/file_selection.py
+++ b/onionshare_gui/file_selection.py
@@ -12,6 +12,7 @@ class FileList(QtGui.QListWidget):
         super(FileList, self).__init__(parent)
         self.setAcceptDrops(True)
         self.setIconSize(QtCore.QSize(32, 32))
+        self.setSortingEnabled(True)
 
         # drag and drop label
         self.drop_label = QtGui.QLabel(QtCore.QString(strings._('gui_drag_and_drop')), parent=self)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git



More information about the Pkg-anonymity-tools mailing list