Skip to content

Instantly share code, notes, and snippets.

@Thynix
Created September 6, 2018 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thynix/5e7417f8796ff5e610622bff0fdd8743 to your computer and use it in GitHub Desktop.
Save Thynix/5e7417f8796ff5e610622bff0fdd8743 to your computer and use it in GitHub Desktop.
pyFreenet diff
diff --git a/fcp/node.py b/fcp/node.py
index c3b03a3..e444469 100644
--- a/fcp/node.py
+++ b/fcp/node.py
@@ -3267,6 +3271,9 @@ def guessMimetype(filename):
"""
if filename.endswith(".tar.bz2"):
return ('application/x-tar', 'bzip2')
+
+ if filename.endswith('.weechatlog'):
+ return 'text/plain'
try:
m = mimetypes.guess_type(filename, False)[0]
diff --git a/fcp/sitemgr.py b/fcp/sitemgr.py
index 0756517..ecbeb94 100644
--- a/fcp/sitemgr.py
+++ b/fcp/sitemgr.py
@@ -1207,7 +1207,7 @@ class SiteState:
"</tr>",
]
- for rec in self.files:
+ for rec in reversed(self.files):
size = getFileSize(rec['path'])
mimetype = rec['mimetype']
name = rec['name']
@@ -1253,7 +1253,7 @@ class SiteState:
"</tr>",
]
- for rec in self.files:
+ for rec in reversed(self.files):
size = getFileSize(rec['path'])
mimetype = rec['mimetype']
name = rec['name']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment