Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf-test.git/shortlog/e271bc41b3a8820d57b4d1fec95495a194d30849
...commit 
http://git.netsurf-browser.org/netsurf-test.git/commit/e271bc41b3a8820d57b4d1fec95495a194d30849
...tree 
http://git.netsurf-browser.org/netsurf-test.git/tree/e271bc41b3a8820d57b4d1fec95495a194d30849

The branch, master has been updated
       via  e271bc41b3a8820d57b4d1fec95495a194d30849 (commit)
      from  0ed395f733752fb58a77c7cc20922dedba2944f2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf-test.git/commit/?id=e271bc41b3a8820d57b4d1fec95495a194d30849
commit e271bc41b3a8820d57b4d1fec95495a194d30849
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    add start and reversed parameters to ordered list generator cgi

diff --git a/cgi-bin/ordered-list.cgi b/cgi-bin/ordered-list.cgi
index 6548699..838e81d 100755
--- a/cgi-bin/ordered-list.cgi
+++ b/cgi-bin/ordered-list.cgi
@@ -25,15 +25,25 @@ def main():
 
     liststyle = 'decimal'
     listcount = 1000
+    liststart = 1
+    listreverse = 0
 
+    # get cgi parameters
     if 'liststyle' in params and re.match('^[A-Za-z0-9-]+$', 
params['liststyle'].value):
         liststyle = params['liststyle'].value
 
     if 'listcount' in params and re.match('^[0-9]+$', 
params['listcount'].value):
         listcount = int(params['listcount'].value)
 
-    if listcount > 10000:
-        listcount = 10000
+    if 'liststart' in params and re.match('^[0-9-]+$', 
params['liststart'].value):
+        liststart = int(params['liststart'].value)
+
+    if 'listreverse' in params and re.match('^[0-1]+$', 
params['listreverse'].value):
+        listreverse = int(params['listreverse'].value)
+
+    # ensure count is reasonable
+    if listcount > 100000:
+        listcount = 100000
         
     print('Content-Type: text/html')
     print('')
@@ -47,8 +57,13 @@ def main():
     print('</head>')
     print('<body>')
     print('<h1>ordered list marker test with',liststyle,'style</h1>')
-    print('<ol class="a">')
-    for num in range(1, listcount):
+    print('<ol class="a"', end='')
+    if liststart != 1:
+        print(' start="{}"'.format(liststart), end='')
+    if listreverse != 0:
+        print(' reversed', end='')
+    print('>')
+    for num in range(liststart, (liststart + listcount)):
         print('<li>',num,'</li>', sep="")
     
     print('</ol>')


-----------------------------------------------------------------------

Summary of changes:
 cgi-bin/ordered-list.cgi |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/cgi-bin/ordered-list.cgi b/cgi-bin/ordered-list.cgi
index 6548699..838e81d 100755
--- a/cgi-bin/ordered-list.cgi
+++ b/cgi-bin/ordered-list.cgi
@@ -25,15 +25,25 @@ def main():
 
     liststyle = 'decimal'
     listcount = 1000
+    liststart = 1
+    listreverse = 0
 
+    # get cgi parameters
     if 'liststyle' in params and re.match('^[A-Za-z0-9-]+$', 
params['liststyle'].value):
         liststyle = params['liststyle'].value
 
     if 'listcount' in params and re.match('^[0-9]+$', 
params['listcount'].value):
         listcount = int(params['listcount'].value)
 
-    if listcount > 10000:
-        listcount = 10000
+    if 'liststart' in params and re.match('^[0-9-]+$', 
params['liststart'].value):
+        liststart = int(params['liststart'].value)
+
+    if 'listreverse' in params and re.match('^[0-1]+$', 
params['listreverse'].value):
+        listreverse = int(params['listreverse'].value)
+
+    # ensure count is reasonable
+    if listcount > 100000:
+        listcount = 100000
         
     print('Content-Type: text/html')
     print('')
@@ -47,8 +57,13 @@ def main():
     print('</head>')
     print('<body>')
     print('<h1>ordered list marker test with',liststyle,'style</h1>')
-    print('<ol class="a">')
-    for num in range(1, listcount):
+    print('<ol class="a"', end='')
+    if liststart != 1:
+        print(' start="{}"'.format(liststart), end='')
+    if listreverse != 0:
+        print(' reversed', end='')
+    print('>')
+    for num in range(liststart, (liststart + listcount)):
         print('<li>',num,'</li>', sep="")
     
     print('</ol>')


-- 
NetSurf test cases
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to