← Back to team overview

team4alfanous team mailing list archive

[Branch ~team4alfanous/alfanous/alfanous-git] Rev 281: Move Defreez_xrange function from console interface to outputs file

 

------------------------------------------------------------
revno: 281
git commit: e9f49575a77e2d5b76335ad524313be8b7eb7b5a
committer: Assem Chelli <assem.ch@xxxxxxxxx>
timestamp: Wed 2012-06-27 23:20:27 +0100
message:
  Move Defreez_xrange function from console interface to outputs file
modified:
  src/alfanous/console.py
  src/alfanous/outputs.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/console.py'
--- src/alfanous/console.py	2012-06-13 23:13:12 +0000
+++ src/alfanous/console.py	2012-06-27 22:20:27 +0000
@@ -37,10 +37,6 @@
 ## a function to decide what is True and what is False
 TRUE_FALSE = lambda x:False if x.lower() in ["no", "none", "null", "0", "-1", "", "false"] else True;
 
-def DEFREEZE_XRANGE( d ):
-    """ TODO reversing the operation of freezing xranges done by module alfanous.output """
-    pass
-
 
 arg_parser = ArgumentParser( 
                               description = INFORMATION["description"],

=== modified file 'src/alfanous/outputs.py'
--- src/alfanous/outputs.py	2012-06-13 10:56:51 +0000
+++ src/alfanous/outputs.py	2012-06-27 22:20:27 +0000
@@ -41,6 +41,9 @@
 			new_d[k] = str( v ) ;
 	return new_d; # JSON doesnt accept serialization of xrange  
 
+def DEFREEZE_XRANGE( d ):
+    """ TODO reversing the operation of freezing xranges done by module alfanous.output """
+    pass
 
 class Raw():
 	""" Basic format for output, as  structures of python
@@ -100,7 +103,7 @@
 			      "highlight": ["css", "html", "genshi", "bold", "bbcode"],
 			      "script": ["standard", "uthmani"],
 			      "vocalized": [True, False],
-			      "recitation": [], #map(lambda x:str(x),range(30)),
+			      "recitation": xrange( 30 ),
 			      "translation": [],
 			      "prev_aya": [True, False],
 			      "next_aya": [True, False],
@@ -113,10 +116,10 @@
 			      "annotation_word":[True, False],
 			      "annotation_aya":[True, False],
 			      "sortedby":["total", "score", "mushaf", "tanzil", "subject"],
-			      "offset":[], #xrange(6237)
-			      "range":[], # xrange(DEFAULTS["maxrange"]) , # used as "perpage" in paging mode 
-			      "page":[], # xrange(6237),  # overridden with offset
-			      "perpage":[], # xrange( DEFAULTS["maxrange"] ) , # overridden with range
+			      "offset": xrange( 6237 ),
+			      "range": xrange( DEFAULTS["maxrange"] ) , # used as "perpage" in paging mode 
+			      "page": xrange( 6237 ), # overridden with offset
+			      "perpage": xrange( DEFAULTS["maxrange"] ) , # overridden with range
 			      "fuzzy":[True, False],
 		}
 
@@ -207,7 +210,7 @@
 			  "fields":self._fields,
 			  "fields_reverse":self._fields_reverse,
 			  "errors":self._errors,
-			  "domains":FREEZE_XRANGE( self._domains ),
+			  "domains": self._domains,
 			  "help_messages": self._helpmessages
 			  }