@@ -41,14 +41,14 @@ def errors_from_list(workflows):
4141 return indict
4242
4343
44- def get_workflow_list_from_location (data_location ):
44+ def open_location (data_location ):
4545 """
4646 This function assumes that the contents of the location is in JSON format.
47- It opens the data location and returns the list of workflows .
47+ It opens the data location and returns the dictionary .
4848
4949 :param str data_location: The location of the file or url
50- :returns: workflow list
51- :rtype: list
50+ :returns: information in the JSON file
51+ :rtype: dict
5252 """
5353 config_dict = serverconfig .config_dict ()
5454
@@ -60,7 +60,7 @@ def get_workflow_list_from_location(data_location):
6060 wkfs = [row for row , in oracle_cursor ]
6161 oracle_db_conn .close ()
6262 cherrypy .log ('Number of workflows from database: %i' % len (wkfs ))
63- return wkfs
63+ return errors_from_list ( wkfs )
6464
6565 raw = None
6666
@@ -87,27 +87,10 @@ def get_workflow_list_from_location(data_location):
8787 if not (keys and isinstance (raw [keys [0 ]], list )):
8888 return raw
8989
90- return [
90+ return errors_from_list ( [
9191 workflow for workflow , statuses in raw .iteritems ()
9292 if True in ['manual' in status for status in statuses ]
93- ]
94-
95-
96- def open_location (data_location ):
97- """
98- This function assumes that the contents of the location is in JSON format.
99- It opens the data location and returns the dictionary.
100-
101- :param str data_location: The location of the file or url
102- :returns: information in the JSON file
103- :rtype: dict
104- """
105- wkfs = get_workflow_list_from_location (data_location )
106-
107- if wkfs :
108- return errors_from_list (wkfs )
109- else :
110- return None
93+ ])
11194
11295
11396def get_list_info (status_list ):
0 commit comments