← Back to team overview

team4alfanous team mailing list archive

[Branch ~team4alfanous/alfanous/alfanous-git] Rev 483: add "aya length" as a new sortedby option

 

------------------------------------------------------------
revno: 483
committer: Assem Chelli <assem.ch@xxxxxxxxx>
timestamp: Sat 2013-01-05 15:00:49 +0100
message:
  add "aya length" as a new sortedby option 
modified:
  src/alfanous/Outputs.py
  src/alfanous/ResultsProcessing.py


--
lp:alfanous
https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git

Your team Alfanous team is subscribed to branch lp:alfanous.
To unsubscribe from this branch go to https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git/+edit-subscription
=== modified file 'src/alfanous/Outputs.py'
--- src/alfanous/Outputs.py	2013-01-05 00:01:14 +0000
+++ src/alfanous/Outputs.py	2013-01-05 14:00:49 +0000
@@ -162,7 +162,7 @@
 			      "aya_sajda_info":	[True, False],
 			      "annotation_word":[True, False],
 			      "annotation_aya":[True, False],
-			      "sortedby":["total", "score", "relevance", "mushaf", "tanzil", "subject"],
+			      "sortedby":["total", "score", "relevance", "mushaf", "tanzil", "subject", "ayalength"],
 			      "offset":[], #xrange(6237)
 			      "range":[], # xrange(DEFAULTS["maxrange"]) , # used as "perpage" in paging mode
 			      "page":[], # xrange(6237),  # overridden with offset

=== modified file 'src/alfanous/ResultsProcessing.py'
--- src/alfanous/ResultsProcessing.py	2012-08-17 11:16:27 +0000
+++ src/alfanous/ResultsProcessing.py	2013-01-05 14:00:49 +0000
@@ -46,17 +46,18 @@
     return methode
 
 def QSort( sortedby ):
-    """         """
+    """  Controls the results sorting options    """
     if sortedby == "mushaf": sortedby = "gid"
     elif sortedby == "tanzil": sortedby = ( "sura_order", "aya_id" )
     elif sortedby == "subject": sortedby = ( "chapter", "topic", "subtopic" )
+    elif sortedby == "ayalength": sortedby = ( "a_l", "a_w" )
     elif sortedby == "relevance" or sortedby == "score": sortedby = None
     else: sortedby = sortedby
     return sortedby
 
 
 def QFilter( results, new_results ):
-    """           """
+    """ Filter give results with new results"""
     results.filter( new_results )
     return results