changeset 2:3e9f4a6803d1

replaced funtion with string.isdigit.
author sean
date Wed, 15 Apr 2015 11:40:28 +0200
parents 2df45f6ecd81
children 99c68ebfb3b9
files collect_issues.py display_issues.py
diffstat 2 files changed, 2 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/collect_issues.py	Tue Apr 14 13:32:12 2015 +0200
+++ b/collect_issues.py	Wed Apr 15 11:40:28 2015 +0200
@@ -25,7 +25,6 @@
     )
 
 save_stats_in_db(LOGIN_PARAMETERS_DEMO, BASE_URL_DEMO, rcd.DATABASE_DEMO, rcd.COLUMNS, rcd.CREATE_DB, rcd.INSERT_NEW, SEARCH_URL_DEMO)
-
 """
 
 import http.cookiejar
@@ -43,10 +42,6 @@
 SEARCH_ROUNDUP = "issue?@action=export_csv&@columns=priority&@filter=status&@pagesize=500&@startwith=0&status=-1,{search_values}"
 
 
-
-
-
-
 def connect_to_server(params, baseurl):
     enc_data = urllib.parse.urlencode(params).encode()
     cj = http.cookiejar.CookieJar()
@@ -96,14 +91,6 @@
                 con.close()
 
 
-def represents_int(s):
-    try:
-        int(s)
-        return True
-    except ValueError:
-        return False
-
-
 def issues_to_quantities(issue_csv, columns, orders_csv):
 
     quantities = [0] * len(columns)
@@ -116,7 +103,7 @@
     for issue in issue_csv:
         priority = issue["priority"]
 
-        if represents_int(priority) == True :
+        if priority.isdigit() == True :
             quantities[order_dict[priority] -1 ] += 1
 
     # print("quantities : " + str(quantities))
@@ -165,7 +152,7 @@
 
         quantities = issues_to_quantities(current_issues_csv, columns, order_csv)
 
-        save_issues_to_db(quantities, db_file, sql_create_db, sql_insert_in_db)
+        # save_issues_to_db(quantities, db_file, sql_create_db, sql_insert_in_db)
 
     except urllib.error.URLError as e:
         print("No Valid Connection to server : " + baseurl + "\nerror: " + str(e))
--- a/display_issues.py	Tue Apr 14 13:32:12 2015 +0200
+++ b/display_issues.py	Wed Apr 15 11:40:28 2015 +0200
@@ -16,7 +16,6 @@
 ##Usage Example: ##
 
 render_db_stats_as_html(rcd.DATABASE_DEMO, rcd.SELECT_ALL)
-
 """
 
 import sqlite3 as db
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)