When I publish a Python toolbox and reference a file on the server's file system, I need to register a folder in Data Stores otherwise the file (from my local machine) will be consolidated.
I would like to suggest introducing a mechanism so a developer can force having resources referenced removing the need to register folders.
It could be as simple as a comment (which the parser will identify) similar to pylint or other tools. Below a quick example:
import json
# ...
DATASOURCE_CONFIG_FILE = r"f:\geoportal\data.json" # esri: disable=consolidate
class Tool(object):
# ...
@staticmethod
def read_datasources():
""" Read datasource config file. """
with open(DATASOURCE_CONFIG_FILE, "r") as config_file:
return json.load(config_file)
Links