Skip to content

Commit

Permalink
Update ramose.py
Browse files Browse the repository at this point in the history
  • Loading branch information
essepuntato committed Mar 26, 2021
1 parent 8722e4e commit 3dc70c5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion ramose.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,19 @@ def exec(self, method="get", content_type="application/json"):


class APIManager(object):
# Fixing max size for CSV
@staticmethod
def __max_size_csv():
from sys import maxsize
import csv
maxInt = maxsize
while True:
try:
csv.field_size_limit(maxInt)
break
except OverflowError:
maxInt = int(maxInt/10)

# Constructor: START
def __init__(self, conf_files):
"""This is the constructor of the APIManager class. It takes in input a list of API configuration files, each
Expand All @@ -1379,6 +1392,8 @@ def __init__(self, conf_files):
In addition, it also defines additional structure, such as the functions to be used for interpreting the
values returned by a SPARQL query, some operations that can be used for filtering the results, and the
HTTP methods to call for making the request to the SPARQL endpoint specified in the configuration file."""
APIManager.__max_size_csv()

self.all_conf = OrderedDict()
self.base_url = []
for conf_file in conf_files:
Expand Down Expand Up @@ -1588,7 +1603,7 @@ def doc(api_url):
else:
# run locally via shell
if args.doc:
res = dh.get_documentation(css_path)
res = dh.get_documentation(css_path) + ("text/html", )
else:
op = am.get_op(args.call)
if type(op) is Operation: # Operation found
Expand Down

0 comments on commit 3dc70c5

Please sign in to comment.