diff MoinMoin/util/interwiki.py @ 2657:080673c3e60a

Now nameless items can also be downloaded and removed unnecessary blank spaces in items/content.py
author Saurabh Kathpalia <saurabh.kathpalia95@gmail.com>
date Sun, 06 Jul 2014 09:25:31 +0530
parents 92a9c6ef1ec7
children
line wrap: on
line diff
--- a/MoinMoin/util/interwiki.py	Fri Jul 04 16:20:40 2014 +0530
+++ b/MoinMoin/util/interwiki.py	Sun Jul 06 09:25:31 2014 +0530
@@ -107,6 +107,16 @@
     return url
 
 
+def get_download_file_name(fqname):
+    """
+    returns the filename that is used for downloading items
+    """
+    if fqname.field == NAME_EXACT:
+        return fqname.value
+    else:
+        return '{0}-{1}'.format(fqname.field, fqname.value)
+
+
 def _split_namespace(namespaces, url):
     """
     Find the longest namespace in the set.