removed unwanted whitespaces

This commit is contained in:
mdipierro
2012-08-16 11:56:07 -05:00
parent f78f27982b
commit a608df5a29
90 changed files with 253 additions and 162 deletions
+1
View File
@@ -262,3 +262,4 @@ if __name__=='__main__':
+1
View File
@@ -242,3 +242,4 @@ if __name__=='__main__':
+1
View File
@@ -4,3 +4,4 @@
+1
View File
@@ -500,3 +500,4 @@ aes_Rcon = array('B',
'c697356ad4b37dfaefc5913972e4d3bd'
'61c29f254a943366cc831d3a74e8cb'.decode('hex')
)
+5 -4
View File
@@ -4,7 +4,7 @@ Released under the web2py license (LGPL)
What does it do?
if html is a variable containing HTML text and urls in the text, when you call
if html is a variable containing HTML text and urls in the text, when you call
html = expend_html(html)
@@ -63,7 +63,7 @@ EMBED_MAPS = [
'http://www.hulu.com/api/oembed.json'),
(re.compile('http://vimeo.com/\S*'),
'http://vimeo.com/api/oembed.json'),
(re.compile('http://www.slideshare.net/[^\/]+/\S*'),
(re.compile('http://www.slideshare.net/[^\/]+/\S*'),
'http://www.slideshare.net/api/oembed/2'),
(re.compile('http://qik.com/\S*'),
'http://qik.com/api/oembed.json'),
@@ -128,8 +128,8 @@ EXTENSION_MAPS = {
def oembed(url):
for k,v in EMBED_MAPS:
if k.match(url):
oembed = v+'?format=json&url='+cgi.escape(url)
if k.match(url):
oembed = v+'?format=json&url='+cgi.escape(url)
try:
return loads(urllib.urlopen(oembed).read())
except:
@@ -196,3 +196,4 @@ if __name__=="__main__":
print expand_html(open(sys.argv[1]).read())
else:
print test()
+1
View File
@@ -193,3 +193,4 @@ if __name__ == "__main__":
+1
View File
@@ -3909,3 +3909,4 @@ def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, refer
+1
View File
@@ -54,3 +54,4 @@ class MemcacheClient(Client):
+1
View File
@@ -89,3 +89,4 @@ def autoretry_datastore_timeouts(attempts=5.0, interval=0.1, exponent=2.0):
+1
View File
@@ -66,3 +66,4 @@ def pdf_from_html(html):
+1
View File
@@ -18,3 +18,4 @@ def button(merchant_id="123456789012345",
+1
View File
@@ -8,3 +8,4 @@ from gluon.dal import DAL, Field, Table, Query, Set, Expression, Row, Rows, driv
+1
View File
@@ -57,3 +57,4 @@ def THUMB(image, nx=120, ny=120, gae=False, name='thumb'):
return thumb
else:
return image
+1
View File
@@ -910,3 +910,4 @@ if __name__ == '__main__':
+1
View File
@@ -126,3 +126,4 @@ if __name__ == "__main__":
+1
View File
@@ -128,3 +128,4 @@ def test():
if __name__ == '__main__':
test()
+1
View File
@@ -170,3 +170,4 @@ if __name__ == '__main__':
+1
View File
@@ -963,3 +963,4 @@ if __name__ == '__main__':
qdb.main(**kwargs)
+1
View File
@@ -166,3 +166,4 @@ class RedisClient(object):
+1
View File
@@ -591,3 +591,4 @@ if __name__ == '__main__':
+1
View File
@@ -269,3 +269,4 @@ if __name__=='__main__':
+1
View File
@@ -150,3 +150,4 @@ if __name__ == "__main__":
print client.add(1, 2)
+1
View File
@@ -115,3 +115,4 @@ def sms_email(number,provider):
+25 -24
View File
@@ -27,7 +27,7 @@ class Node:
self.onchange = onchange
self.size = 4
self.locked = False
def xml(self):
return """<input name="%s" id="%s" value="%s" size="%s"
onkeyup="ajax('%s/keyup',['%s'], ':eval');"
@@ -44,7 +44,7 @@ class Node:
class Sheet:
"""
Basic class for creating web spreadsheets
New features:
-dal spreadsheets:
@@ -105,32 +105,32 @@ class Sheet:
more details)
client JavaScript objects:
-var w2p_spreadsheet_data
Stores cell updates by key and
Used for updated cells control
-var w2p_spreadsheet_update_button
Stores the id of the update command
Used for event binding (update click)
var w2p_spreadsheet_update_result
object attributes:
modified - n updated records
errors - n errors
message - a message for feedback and errors
Stores the ajax db update call returned stats
and the db_callback string js
Used after calling w2p_spreadsheet_update_db()
-function w2p_spreadsheet_update_cell(a)
Used for responding to normal cell events
(encapsulates old behavior)
-function w2p_spreadsheet_update_db_callback(result)
Called after a background db update
-function w2p_spreadsheet_update_db()
Called for updating the database with
client data
@@ -182,7 +182,7 @@ class Sheet:
Second method: Sending data updates with .ajax()
-spreadsheet page's view:
{{
=INPUT(_type="button", _value="update data",
_id="w2p_spreadsheet_update_data")
@@ -223,9 +223,9 @@ class Sheet:
# -Delete checkbox columns for each table and default
# -Deletable=True option for showing/hiding delete checkboxes
# -process() method support for db I/O
"""
regex = re.compile('(?<!\w)[a-zA-Z_]\w*')
pregex = re.compile('\d+')
re_strings = re.compile(r'(?P<name>'
@@ -315,7 +315,7 @@ class Sheet:
changes[tablename][row_id][fieldname] = value
return changes
def process(self, request, db=None, db_callback=None):
"""
@@ -429,7 +429,7 @@ class Sheet:
self.readonly = readonly
self.update_button = update_button
self.client = {
"columns": {},
"colnames": {},
@@ -439,14 +439,14 @@ class Sheet:
"modified": {},
"headers": headers
}
# if db and query:
if self.data is not None:
# retrieve row columns length
self.rows = len(self.data)
# retrieve rows length
self.cols = len(self.data.colnames)
# map row data to rncn values
for x, colname in enumerate(self.data.colnames):
self.client["columns"][colname] = x
@@ -557,7 +557,7 @@ class Sheet:
# one column example:
# {"0": {"value":1.0, "readonly":False, "active":True, "onchange":None}}
# value: common value for all cells
attributes = self.get_attributes(kwarg)
if attributes is not None:
self.tr_attributes[str(row)] = attributes
@@ -593,10 +593,10 @@ class Sheet:
# arg: value pairs
# one row example:
# {"0": {"value":1.0, "readonly":False, "active":True, "onchange":None}}
# value: common value for all cells
# value: common value for all cells
"""
attributes = self.get_attributes(kwarg)
if isinstance(cells, dict):
for row, data in cells.iteritems():
key = "r%sc%s" % (row, col)
@@ -610,7 +610,7 @@ class Sheet:
onchange=onchange, **attributes)
else:
active, onchange, readonly, all_value = \
self.get_cell_arguments(kwarg)
self.get_cell_arguments(kwarg)
for row, cell_value in enumerate(cells):
key = "r%sc%s" % (row, col)
if value is None:
@@ -626,7 +626,7 @@ class Sheet:
Insert a n x n matrix or a set of cells
# starts: upper left cell
# ends: lower right cell
# cells: a sequence of value sequences
# or a dict with "rncn" keys
# Example 1 cells:
@@ -637,7 +637,7 @@ class Sheet:
# value: common value for all cells
"""
attributes = self.get_attributes(kwarg)
starts_r, starts_c = self.position(starts)
ends_r, ends_c = None, None
if ends is not None:
@@ -832,7 +832,7 @@ class Sheet:
jQuery(function(){
jQuery(".%(name)s input").change(w2p_spreadsheet_update_cell);
});
if (w2p_spreadsheet_update_button != ""){
jQuery(function(){
jQuery("#" + w2p_spreadsheet_update_button).click(w2p_spreadsheet_update_db);
@@ -855,7 +855,7 @@ class Sheet:
sorted_headers = [TH(),] + \
[TH(header[1]) for header in sorted(unsorted_headers)]
table.insert(0, TR(*sorted_headers,
table.insert(0, TR(*sorted_headers,
**{_class:"%s_fieldnames" % \
attributes["_class"]}))
else:
@@ -878,3 +878,4 @@ if __name__ == '__main__':
s.cell('c', value="=cos(a)**2+b*b")
print s['c'].computed_value
+1
View File
@@ -65,3 +65,4 @@ if __name__=='__main__':
+1
View File
@@ -246,3 +246,4 @@ class TaskBarIcon:
+1
View File
@@ -94,3 +94,4 @@ if __name__=='__main__':
# You can turn off ordering of results
print(t.getReportText(orderByCost=False))
+1
View File
@@ -519,3 +519,4 @@ class mobilize(object):