mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-01 15:37:32 +08:00
Fix E127 errors introduced by previous commit
using: ``` autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E127 . ```
This commit is contained in:
committed by
Nicola Soranzo
parent
21b44bf348
commit
a353b2e88f
@@ -136,8 +136,8 @@ class Browser:
|
||||
def runtool(self):
|
||||
path = '/api/tools'
|
||||
data = {'tool_id' : self.tool,
|
||||
'history_id' : self.history_id,
|
||||
'inputs' : {'echo' : self.handler}}
|
||||
'history_id' : self.history_id,
|
||||
'inputs' : {'echo' : self.handler}}
|
||||
res = self.req(path, data=data)
|
||||
dprint(json.loads(res.read()))
|
||||
|
||||
|
||||
+13
-13
@@ -273,7 +273,7 @@ class Configuration(object):
|
||||
self.user_activation_on = string_as_bool(kwargs.get('user_activation_on', False))
|
||||
self.activation_grace_period = int(kwargs.get('activation_grace_period', 3))
|
||||
default_inactivity_box_content = ("Your account has not been activated yet. Feel free to browse around and see what's available, but"
|
||||
" you won't be able to upload data or run jobs until you have verified your email address.")
|
||||
" you won't be able to upload data or run jobs until you have verified your email address.")
|
||||
self.inactivity_box_content = kwargs.get('inactivity_box_content', default_inactivity_box_content)
|
||||
self.terms_url = kwargs.get('terms_url', None)
|
||||
self.instance_resource_url = kwargs.get('instance_resource_url', None)
|
||||
@@ -970,11 +970,11 @@ class ConfiguresGalaxyMixin:
|
||||
|
||||
# Initialize tool data tables using the config defined by self.config.tool_data_table_config_path.
|
||||
self.tool_data_tables = ToolDataTableManager(tool_data_path=self.config.tool_data_path,
|
||||
config_filename=self.config.tool_data_table_config_path)
|
||||
config_filename=self.config.tool_data_table_config_path)
|
||||
# Load additional entries defined by self.config.shed_tool_data_table_config into tool data tables.
|
||||
self.tool_data_tables.load_from_config_file(config_filename=self.config.shed_tool_data_table_config,
|
||||
tool_data_path=self.tool_data_tables.tool_data_path,
|
||||
from_shed_config=from_shed_config)
|
||||
tool_data_path=self.tool_data_tables.tool_data_path,
|
||||
from_shed_config=from_shed_config)
|
||||
|
||||
def _configure_datatypes_registry(self, installed_repository_manager=None):
|
||||
from galaxy.datatypes import registry
|
||||
@@ -1047,14 +1047,14 @@ class ConfiguresGalaxyMixin:
|
||||
|
||||
from galaxy.model import mapping
|
||||
self.model = mapping.init(self.config.file_path,
|
||||
db_url,
|
||||
self.config.database_engine_options,
|
||||
map_install_models=combined_install_database,
|
||||
database_query_profiling_proxy=self.config.database_query_profiling_proxy,
|
||||
object_store=self.object_store,
|
||||
trace_logger=getattr(self, "trace_logger", None),
|
||||
use_pbkdf2=self.config.get_bool('use_pbkdf2', True),
|
||||
slow_query_log_threshold=self.config.slow_query_log_threshold)
|
||||
db_url,
|
||||
self.config.database_engine_options,
|
||||
map_install_models=combined_install_database,
|
||||
database_query_profiling_proxy=self.config.database_query_profiling_proxy,
|
||||
object_store=self.object_store,
|
||||
trace_logger=getattr(self, "trace_logger", None),
|
||||
use_pbkdf2=self.config.get_bool('use_pbkdf2', True),
|
||||
slow_query_log_threshold=self.config.slow_query_log_threshold)
|
||||
|
||||
if combined_install_database:
|
||||
log.info("Install database targetting Galaxy's database configuration.")
|
||||
@@ -1065,7 +1065,7 @@ class ConfiguresGalaxyMixin:
|
||||
log.info("Install database using its own connection %s" % install_db_url)
|
||||
install_db_engine_options = self.config.install_database_engine_options
|
||||
self.install_model = install_mapping.init(install_db_url,
|
||||
install_db_engine_options)
|
||||
install_db_engine_options)
|
||||
|
||||
def _configure_signal_handlers(self, handlers):
|
||||
for sig, handler in handlers.items():
|
||||
|
||||
@@ -250,8 +250,8 @@ class Bam(Binary):
|
||||
|
||||
# Get the version of samtools via --version-only, if available
|
||||
p = subprocess.Popen(['samtools', '--version-only'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
output, error = p.communicate()
|
||||
|
||||
# --version-only is available
|
||||
@@ -398,7 +398,7 @@ class Bam(Binary):
|
||||
if exit_code == -6:
|
||||
# SIGABRT, most likely samtools 1.0+ which does not accept the index name parameter.
|
||||
dataset_symlink = os.path.join(os.path.dirname(index_file.file_name),
|
||||
'__dataset_%d_%s' % (dataset.id, os.path.basename(index_file.file_name)))
|
||||
'__dataset_%d_%s' % (dataset.id, os.path.basename(index_file.file_name)))
|
||||
os.symlink(dataset.file_name, dataset_symlink)
|
||||
try:
|
||||
command = ['samtools', 'index', dataset_symlink]
|
||||
@@ -491,7 +491,7 @@ class Bam(Binary):
|
||||
bamline_modified = ('\t').join(bamline.split()[:11] + [(' ').join(bamline.split()[11:])])
|
||||
ck_data = "%s\n%s" % (ck_data, bamline_modified)
|
||||
return dumps({'ck_data': util.unicodify(ck_data),
|
||||
'offset': offset})
|
||||
'offset': offset})
|
||||
|
||||
def display_data(self, trans, dataset, preview=False, filename=None, to_ext=None, offset=None, ck_size=None, **kwd):
|
||||
preview = util.string_as_bool(preview)
|
||||
@@ -510,11 +510,11 @@ class Bam(Binary):
|
||||
if column_number is None:
|
||||
column_number = 1
|
||||
return trans.fill_template("/dataset/tabular_chunked.mako",
|
||||
dataset=dataset,
|
||||
chunk=self.get_chunk(trans, dataset, 0),
|
||||
column_number=column_number,
|
||||
column_names=column_names,
|
||||
column_types=column_types)
|
||||
dataset=dataset,
|
||||
chunk=self.get_chunk(trans, dataset, 0),
|
||||
column_number=column_number,
|
||||
column_names=column_names,
|
||||
column_types=column_types)
|
||||
|
||||
# ------------- Dataproviders
|
||||
# pipe through samtools view
|
||||
@@ -704,7 +704,7 @@ class Bcf(Binary):
|
||||
# Usage: bcftools index <in.bcf>
|
||||
|
||||
dataset_symlink = os.path.join(os.path.dirname(index_file.file_name),
|
||||
'__dataset_%d_%s' % (dataset.id, os.path.basename(index_file.file_name)))
|
||||
'__dataset_%d_%s' % (dataset.id, os.path.basename(index_file.file_name)))
|
||||
os.symlink(dataset.file_name, dataset_symlink)
|
||||
|
||||
stderr_name = tempfile.NamedTemporaryFile(prefix="bcf_index_stderr").name
|
||||
@@ -1022,7 +1022,7 @@ class SQlite (Binary):
|
||||
class GeminiSQLite(SQlite):
|
||||
"""Class describing a Gemini Sqlite database """
|
||||
MetadataElement(name="gemini_version", default='0.10.0', param=MetadataParameter, desc="Gemini Version",
|
||||
readonly=True, visible=True, no_value='0.10.0')
|
||||
readonly=True, visible=True, no_value='0.10.0')
|
||||
file_ext = "gemini.sqlite"
|
||||
edam_format = "format_3622"
|
||||
edam_data = "data_3498"
|
||||
@@ -1043,7 +1043,7 @@ class GeminiSQLite(SQlite):
|
||||
def sniff(self, filename):
|
||||
if super(GeminiSQLite, self).sniff(filename):
|
||||
gemini_table_names = ["gene_detailed", "gene_summary", "resources", "sample_genotype_counts", "sample_genotypes", "samples",
|
||||
"variant_impacts", "variants", "version"]
|
||||
"variant_impacts", "variants", "version"]
|
||||
try:
|
||||
conn = sqlite.connect(filename)
|
||||
c = conn.cursor()
|
||||
@@ -1450,9 +1450,9 @@ Binary.register_sniffable_binary_format("oxli.graphlabels", "oxligl",
|
||||
class SearchGuiArchive (CompressedArchive):
|
||||
"""Class describing a SearchGUI archive """
|
||||
MetadataElement(name="searchgui_version", default='1.28.0', param=MetadataParameter, desc="SearchGui Version",
|
||||
readonly=True, visible=True, no_value=None)
|
||||
readonly=True, visible=True, no_value=None)
|
||||
MetadataElement(name="searchgui_major_version", default='1', param=MetadataParameter, desc="SearchGui Major Version",
|
||||
readonly=True, visible=True, no_value=None)
|
||||
readonly=True, visible=True, no_value=None)
|
||||
file_ext = "searchgui_archive"
|
||||
|
||||
def set_meta(self, dataset, overwrite=True, **kwd):
|
||||
|
||||
@@ -137,15 +137,15 @@ if __name__ == "__main__":
|
||||
subprocess.check_call(commandline, shell=True)
|
||||
|
||||
coverage = CoverageWriter(out_stream=open(out_fname, "a"),
|
||||
chromCol=chr_col_2, positionCol=position_col_2,
|
||||
forwardCol=forward_col_2, reverseCol=reverse_col_2, )
|
||||
chromCol=chr_col_2, positionCol=position_col_2,
|
||||
forwardCol=forward_col_2, reverseCol=reverse_col_2, )
|
||||
temp_file.seek(0)
|
||||
interval = io.NiceReaderWrapper(temp_file,
|
||||
chrom_col=chr_col_1,
|
||||
start_col=start_col_1,
|
||||
end_col=end_col_1,
|
||||
strand_col=strand_col_1,
|
||||
fix_strand=True)
|
||||
chrom_col=chr_col_1,
|
||||
start_col=start_col_1,
|
||||
end_col=end_col_1,
|
||||
strand_col=strand_col_1,
|
||||
fix_strand=True)
|
||||
main(interval, coverage)
|
||||
temp_file.close()
|
||||
coverage.close()
|
||||
|
||||
@@ -35,8 +35,8 @@ def _get_samtools_version():
|
||||
raise Exception('This tool needs samtools, but it is not on PATH.')
|
||||
# Get the version of samtools via --version-only, if available
|
||||
p = subprocess.Popen(['samtools', '--version-only'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
output, error = p.communicate()
|
||||
|
||||
# --version-only is available
|
||||
|
||||
@@ -434,8 +434,8 @@ class Data(object):
|
||||
else:
|
||||
trans.response.set_content_type("text/html")
|
||||
return trans.stream_template_mako("/dataset/large_file.mako",
|
||||
truncated_data=open(data.file_name).read(max_peek_size),
|
||||
data=data)
|
||||
truncated_data=open(data.file_name).read(max_peek_size),
|
||||
data=data)
|
||||
|
||||
def _download_filename(self, dataset, to_ext, hdca=None, element_identifier=None):
|
||||
def escape(raw_identifier):
|
||||
@@ -569,7 +569,7 @@ class Data(object):
|
||||
return target_frame, getattr(self, self.supported_display_apps[type]['links_function'])(dataset, type, app, base_url, **kwd)
|
||||
except:
|
||||
log.exception('Function %s is referred to in datatype %s for generating links for type %s, but is not accessible',
|
||||
self.supported_display_apps[type]['links_function'], self.__class__.__name__, type)
|
||||
self.supported_display_apps[type]['links_function'], self.__class__.__name__, type)
|
||||
return target_frame, []
|
||||
|
||||
def get_converter_types(self, original_dataset, datatypes_registry):
|
||||
|
||||
@@ -42,8 +42,8 @@ class ColumnarDataProvider(line.RegexLineDataProvider):
|
||||
}
|
||||
|
||||
def __init__(self, source, indeces=None,
|
||||
column_count=None, column_types=None, parsers=None, parse_columns=True,
|
||||
deliminator='\t', filters=None, **kwargs):
|
||||
column_count=None, column_types=None, parsers=None, parse_columns=True,
|
||||
deliminator='\t', filters=None, **kwargs):
|
||||
"""
|
||||
:param indeces: a list of indeces of columns to gather from each row
|
||||
Optional: will default to `None`.
|
||||
|
||||
@@ -80,7 +80,7 @@ class DatasetDataProvider(base.DataProvider):
|
||||
:type indeces: list of ints
|
||||
"""
|
||||
metadata_column_types = (self.dataset.metadata.column_types or
|
||||
getattr(self.dataset.datatype, 'column_types', None) or None)
|
||||
getattr(self.dataset.datatype, 'column_types', None) or None)
|
||||
if not metadata_column_types:
|
||||
return metadata_column_types
|
||||
if indeces:
|
||||
@@ -100,7 +100,7 @@ class DatasetDataProvider(base.DataProvider):
|
||||
:type indeces: list of ints
|
||||
"""
|
||||
metadata_column_names = (self.dataset.metadata.column_names or
|
||||
getattr(self.dataset.datatype, 'column_names', None) or None)
|
||||
getattr(self.dataset.datatype, 'column_names', None) or None)
|
||||
if not metadata_column_names:
|
||||
return metadata_column_names
|
||||
if indeces:
|
||||
@@ -123,10 +123,10 @@ class DatasetDataProvider(base.DataProvider):
|
||||
:raises ValueError: if an entry in list_of_column_names is not in column_names
|
||||
"""
|
||||
metadata_column_names = (self.dataset.metadata.column_names or
|
||||
getattr(self.dataset.datatype, 'column_names', None) or None)
|
||||
getattr(self.dataset.datatype, 'column_names', None) or None)
|
||||
if not metadata_column_names:
|
||||
raise KeyError('No column_names found for ' +
|
||||
'datatype: %s, dataset: %s' % (str(self.dataset.datatype), str(self.dataset)))
|
||||
'datatype: %s, dataset: %s' % (str(self.dataset.datatype), str(self.dataset)))
|
||||
indeces = [] # if indeces and column_names:
|
||||
# pull using indeces and re-name with given names - no need to alter (does as super would)
|
||||
# pass
|
||||
@@ -302,7 +302,7 @@ class GenomicRegionDataProvider(column.ColumnarDataProvider):
|
||||
indeces = [chrom_column, start_column, end_column]
|
||||
if not all(_ is not None for _ in indeces):
|
||||
raise ValueError("Could not determine proper column indeces for" +
|
||||
" chrom, start, end: %s" % (str(indeces)))
|
||||
" chrom, start, end: %s" % (str(indeces)))
|
||||
kwargs.update({'indeces' : indeces})
|
||||
|
||||
if not kwargs.get('column_types', None):
|
||||
@@ -344,7 +344,7 @@ class IntervalDataProvider(column.ColumnarDataProvider):
|
||||
}
|
||||
|
||||
def __init__(self, dataset, chrom_column=None, start_column=None, end_column=None,
|
||||
strand_column=None, name_column=None, named_columns=False, **kwargs):
|
||||
strand_column=None, name_column=None, named_columns=False, **kwargs):
|
||||
"""
|
||||
:param dataset: the Galaxy dataset whose file will be the source
|
||||
:type dataset: model.DatasetInstance
|
||||
|
||||
@@ -67,7 +67,7 @@ class XMLDataProvider(HierarchalDataProvider):
|
||||
# TODO: fails with '#' - browser thinks it's an anchor - use urlencode
|
||||
# TODO: need removal/replacement of etree namespacing here - then move to string match
|
||||
return bool((selector is None) or
|
||||
(isinstance(element, Element) and selector in element.tag))
|
||||
(isinstance(element, Element) and selector in element.tag))
|
||||
|
||||
def element_as_dict(self, element):
|
||||
"""
|
||||
|
||||
@@ -32,7 +32,7 @@ class FilteredLineDataProvider(base.LimitedOffsetDataProvider):
|
||||
}
|
||||
|
||||
def __init__(self, source, strip_lines=True, strip_newlines=False, provide_blank=False,
|
||||
comment_char=DEFAULT_COMMENT_CHAR, **kwargs):
|
||||
comment_char=DEFAULT_COMMENT_CHAR, **kwargs):
|
||||
"""
|
||||
:param strip_lines: remove whitespace from the beginning an ending
|
||||
of each line (or not).
|
||||
@@ -153,7 +153,7 @@ class BlockDataProvider(base.LimitedOffsetDataProvider):
|
||||
# composition - not inheritance
|
||||
# TODO: not a fan of this:
|
||||
(filter_fn, limit, offset) = (kwargs.pop('filter_fn', None),
|
||||
kwargs.pop('limit', None), kwargs.pop('offset', 0))
|
||||
kwargs.pop('limit', None), kwargs.pop('offset', 0))
|
||||
line_provider = FilteredLineDataProvider(source, **kwargs)
|
||||
super(BlockDataProvider, self).__init__(line_provider, filter_fn=filter_fn, limit=limit, offset=offset)
|
||||
|
||||
|
||||
@@ -55,12 +55,12 @@ class DisplayApplicationLink(object):
|
||||
def get_display_url(self, data, trans):
|
||||
dataset_hash, user_hash = encode_dataset_user(trans, data, None)
|
||||
return url_for(controller='dataset',
|
||||
action="display_application",
|
||||
dataset_id=dataset_hash,
|
||||
user_id=user_hash,
|
||||
app_name=quote_plus(self.display_application.id),
|
||||
link_name=quote_plus(self.id),
|
||||
app_action=None)
|
||||
action="display_application",
|
||||
dataset_id=dataset_hash,
|
||||
user_id=user_hash,
|
||||
app_name=quote_plus(self.display_application.id),
|
||||
link_name=quote_plus(self.id),
|
||||
app_action=None)
|
||||
|
||||
def get_inital_values(self, data, trans):
|
||||
if self.other_values:
|
||||
|
||||
@@ -156,7 +156,7 @@ class DisplayApplicationTemplateParameter(DisplayApplicationParameter):
|
||||
|
||||
|
||||
parameter_type_to_class = {DisplayApplicationDataParameter.type: DisplayApplicationDataParameter,
|
||||
DisplayApplicationTemplateParameter.type: DisplayApplicationTemplateParameter}
|
||||
DisplayApplicationTemplateParameter.type: DisplayApplicationTemplateParameter}
|
||||
|
||||
|
||||
class DisplayParameterValueWrapper(object):
|
||||
@@ -191,14 +191,14 @@ class DisplayParameterValueWrapper(object):
|
||||
if self.parameter.strip_https and base_url[: 5].lower() == 'https':
|
||||
base_url = "http%s" % base_url[5:]
|
||||
return "%s%s" % (base_url,
|
||||
url_for(controller='dataset',
|
||||
action="display_application",
|
||||
dataset_id=self._dataset_hash,
|
||||
user_id=self._user_hash,
|
||||
app_name=quote_plus(self.parameter.link.display_application.id),
|
||||
link_name=quote_plus(self.parameter.link.id),
|
||||
app_action=self.action_name,
|
||||
action_param=self._url))
|
||||
url_for(controller='dataset',
|
||||
action="display_application",
|
||||
dataset_id=self._dataset_hash,
|
||||
user_id=self._user_hash,
|
||||
app_name=quote_plus(self.parameter.link.display_application.id),
|
||||
link_name=quote_plus(self.parameter.link.id),
|
||||
app_action=self.action_name,
|
||||
action_param=self._url))
|
||||
|
||||
@property
|
||||
def action_name(self):
|
||||
|
||||
@@ -91,9 +91,9 @@ class GenomeGraphs(Tabular):
|
||||
if site_name in app.datatypes_registry.get_display_sites('ucsc'):
|
||||
site_url = site_url.replace('/hgTracks?', '/hgGenome?') # for genome graphs
|
||||
internal_url = "%s" % url_for(controller='dataset',
|
||||
dataset_id=dataset.id,
|
||||
action='display_at',
|
||||
filename='ucsc_' + site_name)
|
||||
dataset_id=dataset.id,
|
||||
action='display_at',
|
||||
filename='ucsc_' + site_name)
|
||||
display_url = "%s%s/display_as?id=%i&display_app=%s&authz_method=display_at" % (base_url, url_for(controller='root'), dataset.id, type)
|
||||
display_url = quote_plus(display_url)
|
||||
# was display_url = quote_plus( "%s/display_as?id=%i&display_app=%s" % (base_url, dataset.id, type) )
|
||||
@@ -278,7 +278,7 @@ class Rgenetics(Html):
|
||||
"""
|
||||
|
||||
MetadataElement(name="base_name", desc="base name for all transformed versions of this genetic dataset", default='RgeneticsData',
|
||||
readonly=True, set_in_upload=True)
|
||||
readonly=True, set_in_upload=True)
|
||||
|
||||
composite_type = 'auto_primary_file'
|
||||
allow_datatype_change = False
|
||||
@@ -389,13 +389,13 @@ class Lped(Rgenetics):
|
||||
def __init__(self, **kwd):
|
||||
Rgenetics.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.ped',
|
||||
description='Pedigree File',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
description='Pedigree File',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
self.add_composite_file('%s.map',
|
||||
description='Map File',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
description='Map File',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
|
||||
|
||||
class Pphe(Rgenetics):
|
||||
@@ -407,9 +407,9 @@ class Pphe(Rgenetics):
|
||||
def __init__(self, **kwd):
|
||||
Rgenetics.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.pphe',
|
||||
description='Plink Phenotype File',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
description='Plink Phenotype File',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
|
||||
|
||||
class Fphe(Rgenetics):
|
||||
@@ -422,8 +422,8 @@ class Fphe(Rgenetics):
|
||||
def __init__(self, **kwd):
|
||||
Rgenetics.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.fphe',
|
||||
description='FBAT Phenotype File',
|
||||
substitute_name_with_metadata='base_name')
|
||||
description='FBAT Phenotype File',
|
||||
substitute_name_with_metadata='base_name')
|
||||
|
||||
|
||||
class Phe(Rgenetics):
|
||||
@@ -435,9 +435,9 @@ class Phe(Rgenetics):
|
||||
def __init__(self, **kwd):
|
||||
Rgenetics.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.phe',
|
||||
description='Phenotype File',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
description='Phenotype File',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
|
||||
|
||||
class Fped(Rgenetics):
|
||||
@@ -450,8 +450,8 @@ class Fped(Rgenetics):
|
||||
def __init__(self, **kwd):
|
||||
Rgenetics.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.fped', description='FBAT format pedfile',
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
substitute_name_with_metadata='base_name',
|
||||
is_binary=False)
|
||||
|
||||
|
||||
class Pbed(Rgenetics):
|
||||
@@ -507,7 +507,7 @@ class Eigenstratpca(Rgenetics):
|
||||
def __init__(self, **kwd):
|
||||
Rgenetics.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.eigenstratpca',
|
||||
description='Eigenstrat PCA file', substitute_name_with_metadata='base_name')
|
||||
description='Eigenstrat PCA file', substitute_name_with_metadata='base_name')
|
||||
|
||||
|
||||
class Snptest(Rgenetics):
|
||||
@@ -534,7 +534,7 @@ class RexpBase(Html):
|
||||
MetadataElement(name="column_names", default=[], desc="Column names", visible=True)
|
||||
MetadataElement(name="pheCols", default=[], desc="Select list for potentially interesting variables", visible=True)
|
||||
MetadataElement(name="base_name",
|
||||
desc="base name for all transformed versions of this expression dataset", default='rexpression', set_in_upload=True)
|
||||
desc="base name for all transformed versions of this expression dataset", default='rexpression', set_in_upload=True)
|
||||
MetadataElement(name="pheno_path", desc="Path to phenotype data for this experiment", default="rexpression.pheno", visible=True)
|
||||
file_ext = 'rexpbase'
|
||||
html_table = None
|
||||
@@ -545,7 +545,7 @@ class RexpBase(Html):
|
||||
def __init__(self, **kwd):
|
||||
Html.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.pheno', description='Phenodata tab text file',
|
||||
substitute_name_with_metadata='base_name', is_binary=False)
|
||||
substitute_name_with_metadata='base_name', is_binary=False)
|
||||
|
||||
def generate_primary_file(self, dataset=None):
|
||||
"""
|
||||
@@ -799,8 +799,8 @@ class Affybatch(RexpBase):
|
||||
def __init__(self, **kwd):
|
||||
RexpBase.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.affybatch',
|
||||
description='AffyBatch R object saved to file',
|
||||
substitute_name_with_metadata='base_name', is_binary=True)
|
||||
description='AffyBatch R object saved to file',
|
||||
substitute_name_with_metadata='base_name', is_binary=True)
|
||||
|
||||
|
||||
class Eset(RexpBase):
|
||||
@@ -812,8 +812,8 @@ class Eset(RexpBase):
|
||||
def __init__(self, **kwd):
|
||||
RexpBase.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.eset',
|
||||
description='ESet R object saved to file',
|
||||
substitute_name_with_metadata='base_name', is_binary=True)
|
||||
description='ESet R object saved to file',
|
||||
substitute_name_with_metadata='base_name', is_binary=True)
|
||||
|
||||
|
||||
class MAlist(RexpBase):
|
||||
@@ -825,8 +825,8 @@ class MAlist(RexpBase):
|
||||
def __init__(self, **kwd):
|
||||
RexpBase.__init__(self, **kwd)
|
||||
self.add_composite_file('%s.malist',
|
||||
description='MAlist R object saved to file',
|
||||
substitute_name_with_metadata='base_name', is_binary=True)
|
||||
description='MAlist R object saved to file',
|
||||
substitute_name_with_metadata='base_name', is_binary=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -47,7 +47,7 @@ class Xgmml(xml.GenericXml):
|
||||
"""
|
||||
if len(split_files) > 1:
|
||||
raise NotImplementedError("Merging multiple XML files is non-trivial " +
|
||||
"and must be implemented for each XML type")
|
||||
"and must be implemented for each XML type")
|
||||
# For one file only, use base class method (move/copy)
|
||||
data.Text.merge(split_files, output_file)
|
||||
|
||||
|
||||
@@ -253,8 +253,8 @@ class Interval(Tabular):
|
||||
# Filter UCSC sites to only those that are supported by this build and
|
||||
# enabled.
|
||||
valid_sites = [(name, url)
|
||||
for name, url in app.datatypes_registry.get_legacy_sites_by_build('ucsc', dataset.dbkey)
|
||||
if name in app.datatypes_registry.get_display_sites('ucsc')]
|
||||
for name, url in app.datatypes_registry.get_legacy_sites_by_build('ucsc', dataset.dbkey)
|
||||
if name in app.datatypes_registry.get_display_sites('ucsc')]
|
||||
if not valid_sites:
|
||||
return []
|
||||
# If there are any valid sites, we need to generate the estimated
|
||||
@@ -266,11 +266,11 @@ class Interval(Tabular):
|
||||
ret_val = []
|
||||
for site_name, site_url in valid_sites:
|
||||
internal_url = url_for(controller='dataset', dataset_id=dataset.id,
|
||||
action='display_at', filename='ucsc_' + site_name)
|
||||
action='display_at', filename='ucsc_' + site_name)
|
||||
display_url = quote_plus("%s%s/display_as?id=%i&display_app=%s&authz_method=display_at" %
|
||||
(base_url, url_for(controller='root'), dataset.id, type))
|
||||
(base_url, url_for(controller='root'), dataset.id, type))
|
||||
redirect_url = quote_plus("%sdb=%s&position=%s:%s-%s&hgt.customText=%%s" %
|
||||
(site_url, dataset.dbkey, chrom, start, stop))
|
||||
(site_url, dataset.dbkey, chrom, start, stop))
|
||||
link = '%s?redirect_url=%s&display_url=%s' % (internal_url, redirect_url, display_url)
|
||||
ret_val.append((site_name, link))
|
||||
return ret_val
|
||||
@@ -342,23 +342,23 @@ class Interval(Tabular):
|
||||
|
||||
# ------------- Dataproviders
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dataprovider(self, dataset, **settings):
|
||||
return dataproviders.dataset.GenomicRegionDataProvider(dataset, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region-dict',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dict_dataprovider(self, dataset, **settings):
|
||||
settings['named_columns'] = True
|
||||
return self.genomic_region_dataprovider(dataset, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('interval',
|
||||
dataproviders.dataset.IntervalDataProvider.settings)
|
||||
dataproviders.dataset.IntervalDataProvider.settings)
|
||||
def interval_dataprovider(self, dataset, **settings):
|
||||
return dataproviders.dataset.IntervalDataProvider(dataset, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('interval-dict',
|
||||
dataproviders.dataset.IntervalDataProvider.settings)
|
||||
dataproviders.dataset.IntervalDataProvider.settings)
|
||||
def interval_dict_dataprovider(self, dataset, **settings):
|
||||
settings['named_columns'] = True
|
||||
return self.interval_dataprovider(dataset, **settings)
|
||||
@@ -626,7 +626,7 @@ class _RemoteCallMixin:
|
||||
internal_url = "%s" % url_for(controller='dataset', dataset_id=dataset.id, action='display_at', filename='%s_%s' % (type, site_name))
|
||||
base_url = app.config.get("display_at_callback", base_url)
|
||||
display_url = quote_plus("%s%s/display_as?id=%i&display_app=%s&authz_method=display_at" %
|
||||
(base_url, url_for(controller='root'), dataset.id, type))
|
||||
(base_url, url_for(controller='root'), dataset.id, type))
|
||||
link = '%s?redirect_url=%s&display_url=%s' % (internal_url, redirect_url, display_url)
|
||||
return link
|
||||
|
||||
@@ -645,7 +645,7 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
"""Add metadata elements"""
|
||||
MetadataElement(name="columns", default=9, desc="Number of columns", readonly=True, visible=False)
|
||||
MetadataElement(name="column_types", default=['str', 'str', 'str', 'int', 'int', 'int', 'str', 'str', 'str'],
|
||||
param=metadata.ColumnTypesParameter, desc="Column types", readonly=True, visible=False)
|
||||
param=metadata.ColumnTypesParameter, desc="Column types", readonly=True, visible=False)
|
||||
|
||||
MetadataElement(name="attributes", default=0, desc="Number of attributes", readonly=True, visible=False, no_value=0)
|
||||
MetadataElement(name="attribute_types", default={}, desc="Attribute types", param=metadata.DictParameter, readonly=True, visible=False, no_value=[])
|
||||
@@ -866,23 +866,23 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
# ------------- Dataproviders
|
||||
# redefine bc super is Tabular
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dataprovider(self, dataset, **settings):
|
||||
return dataproviders.dataset.GenomicRegionDataProvider(dataset, 0, 3, 4, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region-dict',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dict_dataprovider(self, dataset, **settings):
|
||||
settings['named_columns'] = True
|
||||
return self.genomic_region_dataprovider(dataset, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('interval',
|
||||
dataproviders.dataset.IntervalDataProvider.settings)
|
||||
dataproviders.dataset.IntervalDataProvider.settings)
|
||||
def interval_dataprovider(self, dataset, **settings):
|
||||
return dataproviders.dataset.IntervalDataProvider(dataset, 0, 3, 4, 6, 2, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('interval-dict',
|
||||
dataproviders.dataset.IntervalDataProvider.settings)
|
||||
dataproviders.dataset.IntervalDataProvider.settings)
|
||||
def interval_dict_dataprovider(self, dataset, **settings):
|
||||
settings['named_columns'] = True
|
||||
return self.interval_dataprovider(dataset, **settings)
|
||||
@@ -899,7 +899,7 @@ class Gff3(Gff):
|
||||
|
||||
"""Add metadata elements"""
|
||||
MetadataElement(name="column_types", default=['str', 'str', 'str', 'int', 'int', 'float', 'str', 'int', 'list'],
|
||||
param=metadata.ColumnTypesParameter, desc="Column types", readonly=True, visible=False)
|
||||
param=metadata.ColumnTypesParameter, desc="Column types", readonly=True, visible=False)
|
||||
|
||||
def __init__(self, **kwd):
|
||||
"""Initialize datatype, by adding GBrowse display app"""
|
||||
@@ -1015,7 +1015,7 @@ class Gtf(Gff):
|
||||
"""Add metadata elements"""
|
||||
MetadataElement(name="columns", default=9, desc="Number of columns", readonly=True, visible=False)
|
||||
MetadataElement(name="column_types", default=['str', 'str', 'str', 'int', 'int', 'float', 'str', 'int', 'list'],
|
||||
param=metadata.ColumnTypesParameter, desc="Column types", readonly=True, visible=False)
|
||||
param=metadata.ColumnTypesParameter, desc="Column types", readonly=True, visible=False)
|
||||
|
||||
def sniff(self, filename):
|
||||
"""
|
||||
|
||||
@@ -202,8 +202,8 @@ class Registry(object):
|
||||
# the sys.path, probably true but the previous lock wasn't doing that.
|
||||
try:
|
||||
imported_module = __import_module(proprietary_path,
|
||||
proprietary_datatype_module,
|
||||
datatype_class_name)
|
||||
proprietary_datatype_module,
|
||||
datatype_class_name)
|
||||
if imported_module not in self.imported_modules:
|
||||
self.imported_modules.append(imported_module)
|
||||
if hasattr(imported_module, datatype_class_name):
|
||||
@@ -240,7 +240,7 @@ class Registry(object):
|
||||
# Because of the way that the value of can_process_datatype was set above, we know that the value of
|
||||
# override is True.
|
||||
self.log.debug("Overriding conflicting datatype with extension '%s', using datatype from %s." %
|
||||
(str(extension), str(config)))
|
||||
(str(extension), str(config)))
|
||||
if make_subclass:
|
||||
datatype_class = type(datatype_class_name, (datatype_class, ), {})
|
||||
if edam_format:
|
||||
@@ -301,9 +301,9 @@ class Registry(object):
|
||||
# Load datatype sniffers from the config - we'll do this even if one or more datatypes were not properly processed in the config
|
||||
# since sniffers are not tightly coupled with datatypes.
|
||||
self.load_datatype_sniffers(root,
|
||||
deactivate=deactivate,
|
||||
handling_proprietary_datatypes=handling_proprietary_datatypes,
|
||||
override=override)
|
||||
deactivate=deactivate,
|
||||
handling_proprietary_datatypes=handling_proprietary_datatypes,
|
||||
override=override)
|
||||
self.upload_file_formats.sort()
|
||||
# Load build sites
|
||||
self._load_build_sites(root)
|
||||
|
||||
@@ -644,8 +644,8 @@ class BaseFastq (Sequence):
|
||||
self._clean_and_set_mime_type(trans, mime)
|
||||
return fh.read()
|
||||
return trans.stream_template_mako("/dataset/large_file.mako",
|
||||
truncated_data=fh.read(max_peek_size),
|
||||
data=dataset)
|
||||
truncated_data=fh.read(max_peek_size),
|
||||
data=dataset)
|
||||
else:
|
||||
return Sequence.display_data(self, trans, dataset, preview, filename, to_ext, **kwd)
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class TabularData(data.Text):
|
||||
cursor = f.read(1)
|
||||
last_read = f.tell()
|
||||
return dumps({'ck_data': util.unicodify(ck_data),
|
||||
'offset': last_read})
|
||||
'offset': last_read})
|
||||
|
||||
def display_data(self, trans, dataset, preview=False, filename=None, to_ext=None, offset=None, ck_size=None, **kwd):
|
||||
preview = util.string_as_bool(preview)
|
||||
@@ -96,8 +96,8 @@ class TabularData(data.Text):
|
||||
else:
|
||||
trans.response.set_content_type("text/html")
|
||||
return trans.stream_template_mako("/dataset/large_file.mako",
|
||||
truncated_data=open(dataset.file_name).read(max_peek_size),
|
||||
data=dataset)
|
||||
truncated_data=open(dataset.file_name).read(max_peek_size),
|
||||
data=dataset)
|
||||
else:
|
||||
column_names = 'null'
|
||||
if dataset.metadata.column_names:
|
||||
@@ -111,11 +111,11 @@ class TabularData(data.Text):
|
||||
if column_number is None:
|
||||
column_number = 'null'
|
||||
return trans.fill_template("/dataset/tabular_chunked.mako",
|
||||
dataset=dataset,
|
||||
chunk=self.get_chunk(trans, dataset, 0),
|
||||
column_number=column_number,
|
||||
column_names=column_names,
|
||||
column_types=column_types)
|
||||
dataset=dataset,
|
||||
chunk=self.get_chunk(trans, dataset, 0),
|
||||
column_number=column_number,
|
||||
column_names=column_names,
|
||||
column_types=column_types)
|
||||
|
||||
def make_html_table(self, dataset, **kwargs):
|
||||
"""Create HTML table, used for displaying peek"""
|
||||
@@ -219,7 +219,7 @@ class TabularData(data.Text):
|
||||
return dataproviders.column.ColumnarDataProvider(dataset_source, deliminator=delimiter, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('dataset-column',
|
||||
dataproviders.column.ColumnarDataProvider.settings)
|
||||
dataproviders.column.ColumnarDataProvider.settings)
|
||||
def dataset_column_dataprovider(self, dataset, **settings):
|
||||
"""Attempts to get column settings from dataset.metadata"""
|
||||
delimiter = dataset.metadata.delimiter
|
||||
@@ -551,7 +551,7 @@ class Sam(Tabular):
|
||||
return super(Sam, self).column_dataprovider(dataset, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('dataset-column',
|
||||
dataproviders.column.ColumnarDataProvider.settings)
|
||||
dataproviders.column.ColumnarDataProvider.settings)
|
||||
def dataset_column_dataprovider(self, dataset, **settings):
|
||||
settings['comment_char'] = '@'
|
||||
return super(Sam, self).dataset_column_dataprovider(dataset, **settings)
|
||||
@@ -580,13 +580,13 @@ class Sam(Tabular):
|
||||
return self.dict_dataprovider(dataset, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dataprovider(self, dataset, **settings):
|
||||
settings['comment_char'] = '@'
|
||||
return dataproviders.dataset.GenomicRegionDataProvider(dataset, 2, 3, 3, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region-dict',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dict_dataprovider(self, dataset, **settings):
|
||||
settings['comment_char'] = '@'
|
||||
return dataproviders.dataset.GenomicRegionDataProvider(dataset, 2, 3, 3, True, **settings)
|
||||
@@ -661,12 +661,12 @@ class Pileup(Tabular):
|
||||
|
||||
# Dataproviders
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dataprovider(self, dataset, **settings):
|
||||
return dataproviders.dataset.GenomicRegionDataProvider(dataset, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region-dict',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dict_dataprovider(self, dataset, **settings):
|
||||
settings['named_columns'] = True
|
||||
return self.genomic_region_dataprovider(dataset, **settings)
|
||||
@@ -724,12 +724,12 @@ class BaseVcf(Tabular):
|
||||
|
||||
# Dataproviders
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dataprovider(self, dataset, **settings):
|
||||
return dataproviders.dataset.GenomicRegionDataProvider(dataset, 0, 1, 1, **settings)
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('genomic-region-dict',
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
dataproviders.dataset.GenomicRegionDataProvider.settings)
|
||||
def genomic_region_dict_dataprovider(self, dataset, **settings):
|
||||
settings['named_columns'] = True
|
||||
return self.genomic_region_dataprovider(dataset, **settings)
|
||||
@@ -757,7 +757,7 @@ class VcfGz(BaseVcf, binary.Binary):
|
||||
# Usage: bcftools index <in.bcf>
|
||||
|
||||
dataset_symlink = os.path.join(os.path.dirname(index_file.file_name),
|
||||
'__dataset_%d_%s' % (dataset.id, os.path.basename(index_file.file_name))) + ".vcf.gz"
|
||||
'__dataset_%d_%s' % (dataset.id, os.path.basename(index_file.file_name))) + ".vcf.gz"
|
||||
os.symlink(dataset.file_name, dataset_symlink)
|
||||
|
||||
stderr_name = tempfile.NamedTemporaryFile(prefix="bcf_index_stderr").name
|
||||
|
||||
@@ -238,16 +238,16 @@ class Biom1(Json):
|
||||
|
||||
b_transform = {'rows': _transform_dict_list_ids, 'columns': _transform_dict_list_ids}
|
||||
for (m_name, b_name) in [('table_rows', 'rows'),
|
||||
('table_matrix_element_type', 'matrix_element_type'),
|
||||
('table_format', 'format'),
|
||||
('table_generated_by', 'generated_by'),
|
||||
('table_matrix_type', 'matrix_type'),
|
||||
('table_shape', 'shape'),
|
||||
('table_format_url', 'format_url'),
|
||||
('table_date', 'date'),
|
||||
('table_type', 'type'),
|
||||
('table_id', 'id'),
|
||||
('table_columns', 'columns')]:
|
||||
('table_matrix_element_type', 'matrix_element_type'),
|
||||
('table_format', 'format'),
|
||||
('table_generated_by', 'generated_by'),
|
||||
('table_matrix_type', 'matrix_type'),
|
||||
('table_shape', 'shape'),
|
||||
('table_format_url', 'format_url'),
|
||||
('table_date', 'date'),
|
||||
('table_type', 'type'),
|
||||
('table_id', 'id'),
|
||||
('table_columns', 'columns')]:
|
||||
try:
|
||||
metadata_value = json_dict.get(b_name, None)
|
||||
if b_name in b_transform:
|
||||
|
||||
@@ -17,7 +17,7 @@ class GFFInterval(GenomicInterval):
|
||||
only attribute is 'group.'
|
||||
"""
|
||||
def __init__(self, reader, fields, chrom_col=0, feature_col=2, start_col=3, end_col=4,
|
||||
strand_col=6, score_col=5, default_strand='.', fix_strand=False):
|
||||
strand_col=6, score_col=5, default_strand='.', fix_strand=False):
|
||||
# HACK: GFF format allows '.' for strand but GenomicInterval does not. To get around this,
|
||||
# temporarily set strand and then unset after initing GenomicInterval.
|
||||
unknown_strand = False
|
||||
@@ -25,7 +25,7 @@ class GFFInterval(GenomicInterval):
|
||||
unknown_strand = True
|
||||
fields[strand_col] = '+'
|
||||
GenomicInterval.__init__(self, reader, fields, chrom_col, start_col, end_col, strand_col,
|
||||
default_strand, fix_strand=fix_strand)
|
||||
default_strand, fix_strand=fix_strand)
|
||||
if unknown_strand:
|
||||
self.strand = '.'
|
||||
self.fields[strand_col] = '.'
|
||||
@@ -53,12 +53,12 @@ class GFFFeature(GFFInterval):
|
||||
A GFF feature, which can include multiple intervals.
|
||||
"""
|
||||
def __init__(self, reader, chrom_col=0, feature_col=2, start_col=3, end_col=4,
|
||||
strand_col=6, score_col=5, default_strand='.', fix_strand=False, intervals=[],
|
||||
raw_size=0):
|
||||
strand_col=6, score_col=5, default_strand='.', fix_strand=False, intervals=[],
|
||||
raw_size=0):
|
||||
# Use copy so that first interval and feature do not share fields.
|
||||
GFFInterval.__init__(self, reader, copy.deepcopy(intervals[0].fields), chrom_col, feature_col,
|
||||
start_col, end_col, strand_col, score_col, default_strand,
|
||||
fix_strand=fix_strand)
|
||||
start_col, end_col, strand_col, score_col, default_strand,
|
||||
fix_strand=fix_strand)
|
||||
self.intervals = intervals
|
||||
self.raw_size = raw_size
|
||||
# Use intervals to set feature attributes.
|
||||
@@ -66,7 +66,7 @@ class GFFFeature(GFFInterval):
|
||||
# Error checking. NOTE: intervals need not share the same strand.
|
||||
if interval.chrom != self.chrom:
|
||||
raise ValueError("interval chrom does not match self chrom: %s != %s" %
|
||||
(interval.chrom, self.chrom))
|
||||
(interval.chrom, self.chrom))
|
||||
# Set start, end of interval.
|
||||
if interval.start < self.start:
|
||||
self.start = interval.start
|
||||
@@ -113,8 +113,8 @@ class GFFIntervalToBEDReaderWrapper(NiceReaderWrapper):
|
||||
# HACK: this should return a GFF interval, but bx-python operations
|
||||
# require GenomicInterval objects and subclasses will not work.
|
||||
interval = GenomicInterval(self, line.split("\t"), self.chrom_col, self.start_col,
|
||||
self.end_col, self.strand_col, self.default_strand,
|
||||
fix_strand=self.fix_strand)
|
||||
self.end_col, self.strand_col, self.default_strand,
|
||||
fix_strand=self.fix_strand)
|
||||
interval = convert_gff_coords_to_bed(interval)
|
||||
return interval
|
||||
|
||||
@@ -134,9 +134,9 @@ class GFFReaderWrapper(Iterator, NiceReaderWrapper): # Iterator can be removed
|
||||
"""
|
||||
|
||||
def __init__(self, reader, chrom_col=0, feature_col=2, start_col=3,
|
||||
end_col=4, strand_col=6, score_col=5, fix_strand=False, convert_to_bed_coord=False, **kwargs):
|
||||
end_col=4, strand_col=6, score_col=5, fix_strand=False, convert_to_bed_coord=False, **kwargs):
|
||||
NiceReaderWrapper.__init__(self, reader, chrom_col=chrom_col, start_col=start_col, end_col=end_col,
|
||||
strand_col=strand_col, fix_strand=fix_strand, **kwargs)
|
||||
strand_col=strand_col, fix_strand=fix_strand, **kwargs)
|
||||
self.feature_col = feature_col
|
||||
self.score_col = score_col
|
||||
self.convert_to_bed_coord = convert_to_bed_coord
|
||||
@@ -147,8 +147,8 @@ class GFFReaderWrapper(Iterator, NiceReaderWrapper): # Iterator can be removed
|
||||
|
||||
def parse_row(self, line):
|
||||
interval = GFFInterval(self, line.split("\t"), self.chrom_col, self.feature_col,
|
||||
self.start_col, self.end_col, self.strand_col, self.score_col,
|
||||
self.default_strand, fix_strand=self.fix_strand)
|
||||
self.start_col, self.end_col, self.strand_col, self.score_col,
|
||||
self.default_strand, fix_strand=self.fix_strand)
|
||||
return interval
|
||||
|
||||
def __next__(self):
|
||||
@@ -261,9 +261,9 @@ class GFFReaderWrapper(Iterator, NiceReaderWrapper): # Iterator can be removed
|
||||
|
||||
# Return feature.
|
||||
feature = GFFFeature(self, self.chrom_col, self.feature_col, self.start_col,
|
||||
self.end_col, self.strand_col, self.score_col,
|
||||
self.default_strand, fix_strand=self.fix_strand,
|
||||
intervals=feature_intervals, raw_size=raw_size)
|
||||
self.end_col, self.strand_col, self.score_col,
|
||||
self.default_strand, fix_strand=self.fix_strand,
|
||||
intervals=feature_intervals, raw_size=raw_size)
|
||||
|
||||
# Convert to BED coords?
|
||||
if self.convert_to_bed_coord:
|
||||
|
||||
@@ -96,7 +96,7 @@ class ConditionalDependencies(object):
|
||||
|
||||
def check_weberror(self):
|
||||
return (asbool(self.config["debug"]) and
|
||||
asbool(self.config["use_interactive"]))
|
||||
asbool(self.config["use_interactive"]))
|
||||
|
||||
def check_pygments(self):
|
||||
# pygments is a dependency of weberror and only weberror
|
||||
|
||||
@@ -65,10 +65,10 @@ class ExternalServiceAction(object):
|
||||
|
||||
def get_action_access_link(self, trans, param_dict):
|
||||
return url_for(controller='/external_services',
|
||||
action="access_action",
|
||||
external_service_action=self.__action_url_id(param_dict),
|
||||
item=param_dict['item'].id,
|
||||
item_type=param_dict['item'].__class__.__name__)
|
||||
action="access_action",
|
||||
external_service_action=self.__action_url_id(param_dict),
|
||||
item=param_dict['item'].id,
|
||||
item_type=param_dict['item'].__class__.__name__)
|
||||
|
||||
def populate_action(self, param_dict):
|
||||
return PopulatedExternalServiceAction(self, param_dict)
|
||||
|
||||
+32
-32
@@ -30,11 +30,11 @@ class FormDefinitionFactory(object):
|
||||
if form_definition_current is None:
|
||||
form_definition_current = FormDefinitionCurrent()
|
||||
rval = FormDefinition(name=name,
|
||||
desc=description,
|
||||
form_type=self.form_types[form_type],
|
||||
form_definition_current=form_definition_current,
|
||||
layout=layout,
|
||||
fields=fields)
|
||||
desc=description,
|
||||
form_type=self.form_types[form_type],
|
||||
form_definition_current=form_definition_current,
|
||||
layout=layout,
|
||||
fields=fields)
|
||||
form_definition_current.latest_form = rval
|
||||
return rval
|
||||
|
||||
@@ -129,9 +129,9 @@ class FormDefinitionTextFieldFactory(FormDefinitionFieldFactory):
|
||||
Return new FormDefinition field.
|
||||
"""
|
||||
rval = super(FormDefinitionTextFieldFactory, self).new(name=name, label=label,
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
rval['type'] = self.__get_stored_field_type(area)
|
||||
return rval
|
||||
|
||||
@@ -155,9 +155,9 @@ class FormDefinitionPasswordFieldFactory(FormDefinitionFieldFactory):
|
||||
Return new FormDefinition field.
|
||||
"""
|
||||
rval = super(FormDefinitionPasswordFieldFactory, self).new(name=name, label=label,
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
rval['type'] = self.__get_stored_field_type()
|
||||
return rval
|
||||
|
||||
@@ -181,9 +181,9 @@ class FormDefinitionAddressFieldFactory(FormDefinitionFieldFactory):
|
||||
Return new FormDefinition field.
|
||||
"""
|
||||
rval = super(FormDefinitionAddressFieldFactory, self).new(name=name, label=label,
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
rval['type'] = self.__get_stored_field_type()
|
||||
return rval
|
||||
|
||||
@@ -207,9 +207,9 @@ class FormDefinitionWorkflowFieldFactory(FormDefinitionFieldFactory):
|
||||
Return new FormDefinition field.
|
||||
"""
|
||||
rval = super(FormDefinitionWorkflowFieldFactory, self).new(name=name, label=label,
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
rval['type'] = self.__get_stored_field_type()
|
||||
return rval
|
||||
|
||||
@@ -233,9 +233,9 @@ class FormDefinitionWorkflowMappingFieldFactory(FormDefinitionFieldFactory):
|
||||
Return new FormDefinition field.
|
||||
"""
|
||||
rval = super(FormDefinitionWorkflowMappingFieldFactory, self).new(name=name, label=label,
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
rval['type'] = self.__get_stored_field_type()
|
||||
return rval
|
||||
|
||||
@@ -259,9 +259,9 @@ class FormDefinitionHistoryFieldFactory(FormDefinitionFieldFactory):
|
||||
Return new FormDefinition field.
|
||||
"""
|
||||
rval = super(FormDefinitionHistoryFieldFactory, self).new(name=name, label=label,
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
rval['type'] = self.__get_stored_field_type()
|
||||
return rval
|
||||
|
||||
@@ -288,9 +288,9 @@ class FormDefinitionSelectFieldFactory(FormDefinitionFieldFactory):
|
||||
Return new FormDefinition field.
|
||||
"""
|
||||
rval = super(FormDefinitionSelectFieldFactory, self).new(name=name, label=label,
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
required=required, helptext=helptext,
|
||||
default=default, visible=visible,
|
||||
layout=layout)
|
||||
rval['type'] = self.__get_stored_field_type(checkboxes)
|
||||
if options is None:
|
||||
options = []
|
||||
@@ -313,11 +313,11 @@ class FormDefinitionSelectFieldFactory(FormDefinitionFieldFactory):
|
||||
|
||||
|
||||
field_type_factories = dict([(field.type, field()) for field in (FormDefinitionTextFieldFactory,
|
||||
FormDefinitionPasswordFieldFactory,
|
||||
FormDefinitionAddressFieldFactory,
|
||||
FormDefinitionSelectFieldFactory,
|
||||
FormDefinitionWorkflowFieldFactory,
|
||||
FormDefinitionWorkflowMappingFieldFactory,
|
||||
FormDefinitionHistoryFieldFactory)])
|
||||
FormDefinitionPasswordFieldFactory,
|
||||
FormDefinitionAddressFieldFactory,
|
||||
FormDefinitionSelectFieldFactory,
|
||||
FormDefinitionWorkflowFieldFactory,
|
||||
FormDefinitionWorkflowMappingFieldFactory,
|
||||
FormDefinitionHistoryFieldFactory)])
|
||||
|
||||
form_factory = FormDefinitionFactory(FORM_TYPES, field_type_factories)
|
||||
|
||||
+40
-40
@@ -159,8 +159,8 @@ class JobConfiguration(object, ConfiguresHandlers):
|
||||
self.__parse_job_conf_xml(tree)
|
||||
except IOError:
|
||||
log.warning('Job configuration "%s" does not exist, using legacy'
|
||||
' job configuration from Galaxy config file "%s" instead'
|
||||
% (self.app.config.job_config_file, self.app.config.config_file))
|
||||
' job configuration from Galaxy config file "%s" instead'
|
||||
% (self.app.config.job_config_file, self.app.config.config_file))
|
||||
self.__parse_job_conf_legacy()
|
||||
except Exception as e:
|
||||
raise config_exception(e, job_config_file)
|
||||
@@ -313,7 +313,7 @@ class JobConfiguration(object, ConfiguresHandlers):
|
||||
|
||||
if "raw" in self.limits.total_walltime:
|
||||
h, m, s = [int(v) for v in
|
||||
self.limits.total_walltime["raw"].split(':')]
|
||||
self.limits.total_walltime["raw"].split(':')]
|
||||
self.limits.total_walltime["delta"] = datetime.timedelta(
|
||||
0, s, 0, 0, m, h
|
||||
)
|
||||
@@ -648,7 +648,7 @@ class JobConfiguration(object, ConfiguresHandlers):
|
||||
rval[id] = runner_class(self.app, runner['workers'], **runner.get('kwds', {}))
|
||||
except TypeError:
|
||||
log.exception("Job runner '%s:%s' has not been converted to a new-style runner or encountered TypeError on load",
|
||||
module_name, class_name)
|
||||
module_name, class_name)
|
||||
rval[id] = runner_class(self.app)
|
||||
log.debug("Loaded job runner '%s:%s' as '%s'" % (module_name, class_name, id))
|
||||
return rval
|
||||
@@ -912,18 +912,18 @@ class JobWrapper(object, HasResourceParameters):
|
||||
self.tool_working_directory = os.path.join(self.working_directory, "working")
|
||||
safe_makedirs(self.tool_working_directory)
|
||||
log.debug('(%s) Working directory for job is: %s',
|
||||
self.job_id, self.working_directory)
|
||||
self.job_id, self.working_directory)
|
||||
except ObjectInvalid:
|
||||
raise Exception('(%s) Unable to create job working directory',
|
||||
job.id)
|
||||
job.id)
|
||||
|
||||
def clear_working_directory(self):
|
||||
job = self.get_job()
|
||||
if not os.path.exists(self.working_directory):
|
||||
log.warning('(%s): Working directory clear requested but %s does '
|
||||
'not exist',
|
||||
self.job_id,
|
||||
self.working_directory)
|
||||
'not exist',
|
||||
self.job_id,
|
||||
self.working_directory)
|
||||
return
|
||||
|
||||
self.app.object_store.create(
|
||||
@@ -937,7 +937,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
shutil.move(self.working_directory, arc_dir)
|
||||
self._create_working_directory()
|
||||
log.debug('(%s) Previous working directory moved to %s',
|
||||
self.job_id, arc_dir)
|
||||
self.job_id, arc_dir)
|
||||
|
||||
def default_compute_environment(self, job=None):
|
||||
if not job:
|
||||
@@ -1084,7 +1084,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
|
||||
if job.state in model.Job.terminal_states:
|
||||
log.warning("(%s) Ignoring state change from '%s' to '%s' for job "
|
||||
"that is already terminal", job.id, job.state, state)
|
||||
"that is already terminal", job.id, job.state, state)
|
||||
return
|
||||
for dataset_assoc in job.output_datasets + job.output_library_datasets:
|
||||
dataset = dataset_assoc.dataset
|
||||
@@ -1202,7 +1202,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
# and when the job is recovered, it won't be found.
|
||||
if os.path.exists(dataset_path.real_path) and os.stat(dataset_path.real_path).st_size > 0:
|
||||
log.warning("finish(): %s not found, but %s is not empty, so it will be used instead"
|
||||
% (dataset_path.false_path, dataset_path.real_path))
|
||||
% (dataset_path.false_path, dataset_path.real_path))
|
||||
else:
|
||||
# Prior to fail we need to set job.state
|
||||
job.set_state(final_job_state)
|
||||
@@ -1399,8 +1399,8 @@ class JobWrapper(object, HasResourceParameters):
|
||||
self.tool.exec_after_process(self.queue.app, inp_data, out_data, param_dict, job=job)
|
||||
# Call 'exec_after_process' hook
|
||||
self.tool.call_hook('exec_after_process', self.queue.app, inp_data=inp_data,
|
||||
out_data=out_data, param_dict=param_dict,
|
||||
tool=self.tool, stdout=job.stdout, stderr=job.stderr)
|
||||
out_data=out_data, param_dict=param_dict,
|
||||
tool=self.tool, stdout=job.stdout, stderr=job.stderr)
|
||||
job.command_line = unicodify(self.command_line)
|
||||
|
||||
collected_bytes = 0
|
||||
@@ -1509,14 +1509,14 @@ class JobWrapper(object, HasResourceParameters):
|
||||
if size > self.app.job_config.limits.output_size:
|
||||
log.warning('(%s) Job output size %s has exceeded the global output size limit', self.get_id_tag(), os.path.basename(outfile))
|
||||
return (JobState.runner_states.OUTPUT_SIZE_LIMIT,
|
||||
'Job output file grew too large (greater than %s), please try different inputs or parameters'
|
||||
% util.nice_size(self.app.job_config.limits.output_size))
|
||||
'Job output file grew too large (greater than %s), please try different inputs or parameters'
|
||||
% util.nice_size(self.app.job_config.limits.output_size))
|
||||
if self.app.job_config.limits.walltime_delta is not None and runtime is not None:
|
||||
if runtime > self.app.job_config.limits.walltime_delta:
|
||||
log.warning('(%s) Job runtime %s has exceeded the global walltime, it will be terminated', self.get_id_tag(), runtime)
|
||||
return (JobState.runner_states.GLOBAL_WALLTIME_REACHED,
|
||||
'Job ran longer than the maximum allowed execution time (runtime: %s, limit: %s), please try different inputs or parameters'
|
||||
% (str(runtime).split('.')[0], self.app.job_config.limits.walltime))
|
||||
'Job ran longer than the maximum allowed execution time (runtime: %s, limit: %s), please try different inputs or parameters'
|
||||
% (str(runtime).split('.')[0], self.app.job_config.limits.walltime))
|
||||
return None
|
||||
|
||||
def has_limits(self):
|
||||
@@ -1657,15 +1657,15 @@ class JobWrapper(object, HasResourceParameters):
|
||||
def invalidate_external_metadata(self):
|
||||
job = self.get_job()
|
||||
self.external_output_metadata.invalidate_external_metadata([output_dataset_assoc.dataset for
|
||||
output_dataset_assoc in
|
||||
job.output_datasets + job.output_library_datasets],
|
||||
self.sa_session)
|
||||
output_dataset_assoc in
|
||||
job.output_datasets + job.output_library_datasets],
|
||||
self.sa_session)
|
||||
|
||||
def setup_external_metadata(self, exec_dir=None, tmp_dir=None,
|
||||
dataset_files_path=None, config_root=None,
|
||||
config_file=None, datatypes_config=None,
|
||||
resolve_metadata_dependencies=False,
|
||||
set_extension=True, **kwds):
|
||||
dataset_files_path=None, config_root=None,
|
||||
config_file=None, datatypes_config=None,
|
||||
resolve_metadata_dependencies=False,
|
||||
set_extension=True, **kwds):
|
||||
# extension could still be 'auto' if this is the upload tool.
|
||||
job = self.get_job()
|
||||
if set_extension:
|
||||
@@ -1686,18 +1686,18 @@ class JobWrapper(object, HasResourceParameters):
|
||||
if datatypes_config is None:
|
||||
datatypes_config = self.app.datatypes_registry.integrated_datatypes_configs
|
||||
command = self.external_output_metadata.setup_external_metadata([output_dataset_assoc.dataset for
|
||||
output_dataset_assoc in
|
||||
job.output_datasets + job.output_library_datasets],
|
||||
self.sa_session,
|
||||
exec_dir=exec_dir,
|
||||
tmp_dir=tmp_dir,
|
||||
dataset_files_path=dataset_files_path,
|
||||
config_root=config_root,
|
||||
config_file=config_file,
|
||||
datatypes_config=datatypes_config,
|
||||
job_metadata=os.path.join(self.tool_working_directory, TOOL_PROVIDED_JOB_METADATA_FILE),
|
||||
max_metadata_value_size=self.app.config.max_metadata_value_size,
|
||||
**kwds)
|
||||
output_dataset_assoc in
|
||||
job.output_datasets + job.output_library_datasets],
|
||||
self.sa_session,
|
||||
exec_dir=exec_dir,
|
||||
tmp_dir=tmp_dir,
|
||||
dataset_files_path=dataset_files_path,
|
||||
config_root=config_root,
|
||||
config_file=config_file,
|
||||
datatypes_config=datatypes_config,
|
||||
job_metadata=os.path.join(self.tool_working_directory, TOOL_PROVIDED_JOB_METADATA_FILE),
|
||||
max_metadata_value_size=self.app.config.max_metadata_value_size,
|
||||
**kwds)
|
||||
if resolve_metadata_dependencies:
|
||||
metadata_tool = self.app.toolbox.get_tool("__SET_METADATA__")
|
||||
if metadata_tool is not None:
|
||||
@@ -1940,7 +1940,7 @@ class TaskWrapper(JobWrapper):
|
||||
|
||||
# This may have ended too soon
|
||||
log.debug('task %s for job %d ended; exit code: %d'
|
||||
% (self.task_id, self.job_id,
|
||||
% (self.task_id, self.job_id,
|
||||
tool_exit_code if tool_exit_code is not None else -256))
|
||||
# default post job setup_external_metadata
|
||||
self.sa_session.expunge_all()
|
||||
@@ -1993,8 +1993,8 @@ class TaskWrapper(JobWrapper):
|
||||
pass
|
||||
|
||||
def setup_external_metadata(self, exec_dir=None, tmp_dir=None, dataset_files_path=None,
|
||||
config_root=None, config_file=None, datatypes_config=None,
|
||||
set_extension=True, **kwds):
|
||||
config_root=None, config_file=None, datatypes_config=None,
|
||||
set_extension=True, **kwds):
|
||||
# There is no metadata setting for tasks. This is handled after the merge, at the job level.
|
||||
return ""
|
||||
|
||||
|
||||
@@ -347,9 +347,9 @@ class TagDatasetAction(DefaultJobAction):
|
||||
def get_short_str(cls, pja):
|
||||
if pja.action_arguments and pja.action_arguments.get('tags', ''):
|
||||
return "%s tag(s) '%s' %s '%s'." % (cls.action,
|
||||
escape(pja.action_arguments['tags']),
|
||||
cls.direction,
|
||||
escape(pja.output_name))
|
||||
escape(pja.action_arguments['tags']),
|
||||
cls.direction,
|
||||
escape(pja.output_name))
|
||||
else:
|
||||
return "%s Tag action used without a tag specified. No tag will be added." % cls.action
|
||||
|
||||
@@ -368,13 +368,13 @@ class RemoveTagDatasetAction(TagDatasetAction):
|
||||
class ActionBox(object):
|
||||
|
||||
actions = {"RenameDatasetAction": RenameDatasetAction,
|
||||
"HideDatasetAction": HideDatasetAction,
|
||||
"ChangeDatatypeAction": ChangeDatatypeAction,
|
||||
"ColumnSetAction": ColumnSetAction,
|
||||
"EmailAction": EmailAction,
|
||||
"DeleteIntermediatesAction": DeleteIntermediatesAction,
|
||||
"TagDatasetAction": TagDatasetAction,
|
||||
"RemoveTagDatasetAction": RemoveTagDatasetAction,
|
||||
"HideDatasetAction": HideDatasetAction,
|
||||
"ChangeDatatypeAction": ChangeDatatypeAction,
|
||||
"ColumnSetAction": ColumnSetAction,
|
||||
"EmailAction": EmailAction,
|
||||
"DeleteIntermediatesAction": DeleteIntermediatesAction,
|
||||
"TagDatasetAction": TagDatasetAction,
|
||||
"RemoveTagDatasetAction": RemoveTagDatasetAction,
|
||||
}
|
||||
public_actions = ['RenameDatasetAction', 'ChangeDatatypeAction',
|
||||
'ColumnSetAction', 'EmailAction',
|
||||
|
||||
@@ -15,8 +15,8 @@ log = logging.getLogger(__name__)
|
||||
|
||||
class DeferredJobQueue(object):
|
||||
job_states = Bunch(READY='ready',
|
||||
WAIT='wait',
|
||||
INVALID='invalid')
|
||||
WAIT='wait',
|
||||
INVALID='invalid')
|
||||
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
||||
@@ -43,9 +43,9 @@ class DataTransfer(object):
|
||||
results = []
|
||||
for result in job.params['results'].values():
|
||||
result['transfer_job'] = self.app.transfer_manager.new(protocol=job.params['protocol'],
|
||||
name=result['name'],
|
||||
datatype=result['datatype'],
|
||||
url=result['url'])
|
||||
name=result['name'],
|
||||
datatype=result['datatype'],
|
||||
url=result['url'])
|
||||
results.append(result)
|
||||
elif job.params['protocol'] == 'scp':
|
||||
results = []
|
||||
@@ -57,32 +57,32 @@ class DataTransfer(object):
|
||||
for sample_dataset_id, sample_dataset_info_dict in sample_datasets_dict.items():
|
||||
result = {}
|
||||
result['transfer_job'] = self.app.transfer_manager.new(protocol=job.params['protocol'],
|
||||
host=job.params['host'],
|
||||
user_name=job.params['user_name'],
|
||||
password=job.params['password'],
|
||||
sample_dataset_id=sample_dataset_id,
|
||||
status=sample_dataset_info_dict['status'],
|
||||
name=sample_dataset_info_dict['name'],
|
||||
file_path=sample_dataset_info_dict['file_path'],
|
||||
sample_id=sample_dataset_info_dict['sample_id'],
|
||||
external_service_id=sample_dataset_info_dict['external_service_id'],
|
||||
error_msg=sample_dataset_info_dict['error_msg'],
|
||||
size=sample_dataset_info_dict['size'])
|
||||
host=job.params['host'],
|
||||
user_name=job.params['user_name'],
|
||||
password=job.params['password'],
|
||||
sample_dataset_id=sample_dataset_id,
|
||||
status=sample_dataset_info_dict['status'],
|
||||
name=sample_dataset_info_dict['name'],
|
||||
file_path=sample_dataset_info_dict['file_path'],
|
||||
sample_id=sample_dataset_info_dict['sample_id'],
|
||||
external_service_id=sample_dataset_info_dict['external_service_id'],
|
||||
error_msg=sample_dataset_info_dict['error_msg'],
|
||||
size=sample_dataset_info_dict['size'])
|
||||
results.append(result)
|
||||
self.app.transfer_manager.run([r['transfer_job'] for r in results])
|
||||
for result in results:
|
||||
transfer_job = result.pop('transfer_job')
|
||||
self.create_job(None,
|
||||
transfer_job_id=transfer_job.id,
|
||||
result=transfer_job.params,
|
||||
sample_id=job.params['sample_id'])
|
||||
transfer_job_id=transfer_job.id,
|
||||
result=transfer_job.params,
|
||||
sample_id=job.params['sample_id'])
|
||||
# Update the state of the relevant SampleDataset
|
||||
new_status = self.app.model.SampleDataset.transfer_status.IN_QUEUE
|
||||
self._update_sample_dataset_status(protocol=job.params['protocol'],
|
||||
sample_id=job.params['sample_id'],
|
||||
result_dict=transfer_job.params,
|
||||
new_status=new_status,
|
||||
error_msg='')
|
||||
sample_id=job.params['sample_id'],
|
||||
result_dict=transfer_job.params,
|
||||
new_status=new_status,
|
||||
error_msg='')
|
||||
job.state = self.app.model.DeferredJob.states.OK
|
||||
self.sa_session.add(job)
|
||||
self.sa_session.flush()
|
||||
@@ -112,21 +112,21 @@ class DataTransfer(object):
|
||||
# Determine the data format (see the relevant TODO item in the manual_data_transfer plugin)..
|
||||
extension = sniff.guess_ext(result_dict['local_path'], sniff_order=self.app.datatypes_registry.sniff_order)
|
||||
self._update_sample_dataset_status(protocol=job.params['protocol'],
|
||||
sample_id=int(job.params['sample_id']),
|
||||
result_dict=result_dict,
|
||||
new_status=new_status,
|
||||
error_msg='')
|
||||
sample_id=int(job.params['sample_id']),
|
||||
result_dict=result_dict,
|
||||
new_status=new_status,
|
||||
error_msg='')
|
||||
sample = self.sa_session.query(self.app.model.Sample).get(int(job.params['sample_id']))
|
||||
ld = self.app.model.LibraryDataset(folder=sample.folder, name=library_dataset_name)
|
||||
self.sa_session.add(ld)
|
||||
self.sa_session.flush()
|
||||
self.app.security_agent.copy_library_permissions(FakeTrans(self.app), sample.folder, ld)
|
||||
ldda = self.app.model.LibraryDatasetDatasetAssociation(name=library_dataset_name,
|
||||
extension=extension,
|
||||
dbkey='?',
|
||||
library_dataset=ld,
|
||||
create_dataset=True,
|
||||
sa_session=self.sa_session)
|
||||
extension=extension,
|
||||
dbkey='?',
|
||||
library_dataset=ld,
|
||||
create_dataset=True,
|
||||
sa_session=self.sa_session)
|
||||
ldda.message = 'Transferred by the Data Transfer Plugin'
|
||||
self.sa_session.add(ldda)
|
||||
self.sa_session.flush()
|
||||
@@ -143,17 +143,17 @@ class DataTransfer(object):
|
||||
if spec.get('default'):
|
||||
setattr(ldda.metadata, name, spec.unwrap(spec.get('default')))
|
||||
self.app.datatypes_registry.set_external_metadata_tool.tool_action.execute(self.app.datatypes_registry.set_external_metadata_tool,
|
||||
FakeTrans(self.app,
|
||||
history=sample.history,
|
||||
user=sample.request.user),
|
||||
incoming={'input1': ldda})
|
||||
FakeTrans(self.app,
|
||||
history=sample.history,
|
||||
user=sample.request.user),
|
||||
incoming={'input1': ldda})
|
||||
ldda.state = ldda.states.OK
|
||||
# TODO: not sure if this flush is necessary
|
||||
self.sa_session.add(ldda)
|
||||
self.sa_session.flush()
|
||||
except Exception as e:
|
||||
log.exception('Failure preparing library dataset for finished transfer job (id: %s) via deferred job (id: %s):' %
|
||||
(str(job.transfer_job.id), str(job.id)))
|
||||
(str(job.transfer_job.id), str(job.id)))
|
||||
ldda.state = ldda.states.ERROR
|
||||
if sample.workflow:
|
||||
log.debug("\n\nLogging sample mappings as: %s" % sample.workflow['mappings'])
|
||||
@@ -199,10 +199,10 @@ class DataTransfer(object):
|
||||
# Update the state of the relevant SampleDataset
|
||||
new_status = self.app.model.SampleDataset.transfer_status.COMPLETE
|
||||
self._update_sample_dataset_status(protocol=job.params['protocol'],
|
||||
sample_id=int(job.params['sample_id']),
|
||||
result_dict=job.params['result'],
|
||||
new_status=new_status,
|
||||
error_msg='')
|
||||
sample_id=int(job.params['sample_id']),
|
||||
result_dict=job.params['result'],
|
||||
new_status=new_status,
|
||||
error_msg='')
|
||||
if sample.datasets and not sample.untransferred_dataset_files:
|
||||
# Update the state of the sample to the sample's request type's final state.
|
||||
new_state = sample.request.type.final_sample_state
|
||||
@@ -225,8 +225,8 @@ class DataTransfer(object):
|
||||
if protocol in ['http', 'https']:
|
||||
sample_dataset = self.sa_session.query(self.app.model.SampleDataset) \
|
||||
.filter(and_(self.app.model.SampleDataset.table.c.sample_id == sample_id,
|
||||
self.app.model.SampleDataset.table.c.name == result_dict['name'],
|
||||
self.app.model.SampleDataset.table.c.file_path == result_dict['url'])) \
|
||||
self.app.model.SampleDataset.table.c.name == result_dict['name'],
|
||||
self.app.model.SampleDataset.table.c.file_path == result_dict['url'])) \
|
||||
.first()
|
||||
elif protocol in ['scp']:
|
||||
sample_dataset = self.sa_session.query(self.app.model.SampleDataset).get(int(result_dict['sample_dataset_id']))
|
||||
|
||||
@@ -45,32 +45,32 @@ class ManualDataTransferPlugin(DataTransfer):
|
||||
for sample_dataset in sample_datasets:
|
||||
sample_dataset_id = sample_dataset.id
|
||||
sample_dataset_dict = dict(sample_id=sample_dataset.sample.id,
|
||||
name=sample_dataset.name,
|
||||
file_path=sample_dataset.file_path,
|
||||
status=sample_dataset.status,
|
||||
error_msg=sample_dataset.error_msg,
|
||||
size=sample_dataset.size,
|
||||
external_service_id=sample_dataset.external_service.id)
|
||||
name=sample_dataset.name,
|
||||
file_path=sample_dataset.file_path,
|
||||
status=sample_dataset.status,
|
||||
error_msg=sample_dataset.error_msg,
|
||||
size=sample_dataset.size,
|
||||
external_service_id=sample_dataset.external_service.id)
|
||||
sample_datasets_dict[sample_dataset_id] = sample_dataset_dict
|
||||
params = {'type' : 'init_transfer',
|
||||
'sample_id' : sample.id,
|
||||
'sample_datasets_dict' : sample_datasets_dict,
|
||||
'protocol' : protocol,
|
||||
'host' : host,
|
||||
'user_name' : user_name,
|
||||
'password' : password}
|
||||
'sample_id' : sample.id,
|
||||
'sample_datasets_dict' : sample_datasets_dict,
|
||||
'protocol' : protocol,
|
||||
'host' : host,
|
||||
'user_name' : user_name,
|
||||
'password' : password}
|
||||
elif 'transfer_job_id' in kwd:
|
||||
params = {'type' : 'finish_transfer',
|
||||
'protocol' : kwd['result']['protocol'],
|
||||
'sample_id' : kwd['sample_id'],
|
||||
'result' : kwd['result'],
|
||||
'transfer_job_id' : kwd['transfer_job_id']}
|
||||
'protocol' : kwd['result']['protocol'],
|
||||
'sample_id' : kwd['sample_id'],
|
||||
'result' : kwd['result'],
|
||||
'transfer_job_id' : kwd['transfer_job_id']}
|
||||
else:
|
||||
log.error('No job was created because kwd does not include "samples" and "sample_datasets" or "transfer_job_id".')
|
||||
return
|
||||
deferred_job = self.app.model.DeferredJob(state=self.app.model.DeferredJob.states.NEW,
|
||||
plugin='ManualDataTransferPlugin',
|
||||
params=params)
|
||||
plugin='ManualDataTransferPlugin',
|
||||
params=params)
|
||||
self.sa_session.add(deferred_job)
|
||||
self.sa_session.flush()
|
||||
log.debug('Created a deferred job in the ManualDataTransferPlugin of type: %s' % params['type'])
|
||||
|
||||
@@ -57,25 +57,25 @@ class SMRTPortalPlugin(DataTransfer):
|
||||
self.sa_session.add(sample)
|
||||
self.sa_session.flush()
|
||||
params = {'type' : 'init_transfer',
|
||||
'protocol' : protocol,
|
||||
'sample_id' : sample.id,
|
||||
'results' : results,
|
||||
'smrt_host' : smrt_host,
|
||||
'smrt_job_id' : smrt_job_id}
|
||||
'protocol' : protocol,
|
||||
'sample_id' : sample.id,
|
||||
'results' : results,
|
||||
'smrt_host' : smrt_host,
|
||||
'smrt_job_id' : smrt_job_id}
|
||||
# Create a new SampleDataset for each run result dataset
|
||||
self._associate_untransferred_datasets_with_sample(sample, external_service, results)
|
||||
elif 'transfer_job_id' in kwd:
|
||||
params = {'type' : 'finish_transfer',
|
||||
'protocol' : kwd['result']['protocol'],
|
||||
'sample_id' : kwd['sample_id'],
|
||||
'result' : kwd['result'],
|
||||
'transfer_job_id' : kwd['transfer_job_id']}
|
||||
'protocol' : kwd['result']['protocol'],
|
||||
'sample_id' : kwd['sample_id'],
|
||||
'result' : kwd['result'],
|
||||
'transfer_job_id' : kwd['transfer_job_id']}
|
||||
else:
|
||||
log.error('No job was created because kwd does not include "secondary_analysis_job_id" or "transfer_job_id".')
|
||||
return
|
||||
deferred_job = self.app.model.DeferredJob(state=self.app.model.DeferredJob.states.NEW,
|
||||
plugin='SMRTPortalPlugin',
|
||||
params=params)
|
||||
plugin='SMRTPortalPlugin',
|
||||
params=params)
|
||||
self.sa_session.add(deferred_job)
|
||||
self.sa_session.flush()
|
||||
log.debug('Created a deferred job in the SMRTPortalPlugin of type: %s' % params['type'])
|
||||
@@ -122,11 +122,11 @@ class SMRTPortalPlugin(DataTransfer):
|
||||
name = val['name']
|
||||
size = 'unknown'
|
||||
sample_dataset = self.app.model.SampleDataset(sample=sample,
|
||||
file_path=file_path,
|
||||
status=status,
|
||||
name=name,
|
||||
error_msg='',
|
||||
size=size,
|
||||
external_service=external_service)
|
||||
file_path=file_path,
|
||||
status=status,
|
||||
name=name,
|
||||
error_msg='',
|
||||
size=size,
|
||||
external_service=external_service)
|
||||
self.sa_session.add(sample_dataset)
|
||||
self.sa_session.flush()
|
||||
|
||||
@@ -20,6 +20,6 @@ class StdioErrorLevel(object):
|
||||
def desc(error_level):
|
||||
err_msg = "Unknown error"
|
||||
if (error_level > 0 and
|
||||
error_level <= StdioErrorLevel.MAX):
|
||||
error_level <= StdioErrorLevel.MAX):
|
||||
err_msg = StdioErrorLevel.descs[error_level]
|
||||
return err_msg
|
||||
|
||||
+18
-18
@@ -103,21 +103,21 @@ class JobHandlerQueue(object):
|
||||
jobs_at_startup = []
|
||||
if self.track_jobs_in_database:
|
||||
in_list = (model.Job.states.QUEUED,
|
||||
model.Job.states.RUNNING)
|
||||
model.Job.states.RUNNING)
|
||||
else:
|
||||
in_list = (model.Job.states.NEW,
|
||||
model.Job.states.QUEUED,
|
||||
model.Job.states.RUNNING)
|
||||
model.Job.states.QUEUED,
|
||||
model.Job.states.RUNNING)
|
||||
if self.app.config.user_activation_on:
|
||||
jobs_at_startup = self.sa_session.query(model.Job).enable_eagerloads(False) \
|
||||
.outerjoin(model.User) \
|
||||
.filter(model.Job.state.in_(in_list) &
|
||||
(model.Job.handler == self.app.config.server_name) &
|
||||
or_((model.Job.user_id == null()), (model.User.active == true()))).all()
|
||||
(model.Job.handler == self.app.config.server_name) &
|
||||
or_((model.Job.user_id == null()), (model.User.active == true()))).all()
|
||||
else:
|
||||
jobs_at_startup = self.sa_session.query(model.Job).enable_eagerloads(False) \
|
||||
.filter(model.Job.state.in_(in_list) &
|
||||
(model.Job.handler == self.app.config.server_name)).all()
|
||||
(model.Job.handler == self.app.config.server_name)).all()
|
||||
|
||||
for job in jobs_at_startup:
|
||||
if not self.app.toolbox.has_tool(job.tool_id, job.tool_version, exact=True):
|
||||
@@ -209,10 +209,10 @@ class JobHandlerQueue(object):
|
||||
.join(model.HistoryDatasetAssociation) \
|
||||
.join(model.Dataset) \
|
||||
.filter(and_((model.Job.state == model.Job.states.NEW),
|
||||
or_((model.HistoryDatasetAssociation._state == model.HistoryDatasetAssociation.states.FAILED_METADATA),
|
||||
(model.HistoryDatasetAssociation.deleted == true()),
|
||||
(model.Dataset.state != model.Dataset.states.OK),
|
||||
(model.Dataset.deleted == true())))).subquery()
|
||||
or_((model.HistoryDatasetAssociation._state == model.HistoryDatasetAssociation.states.FAILED_METADATA),
|
||||
(model.HistoryDatasetAssociation.deleted == true()),
|
||||
(model.Dataset.state != model.Dataset.states.OK),
|
||||
(model.Dataset.deleted == true())))).subquery()
|
||||
ldda_not_ready = self.sa_session.query(model.Job.id).enable_eagerloads(False) \
|
||||
.join(model.JobToInputLibraryDatasetAssociation) \
|
||||
.join(model.LibraryDatasetDatasetAssociation) \
|
||||
@@ -291,7 +291,7 @@ class JobHandlerQueue(object):
|
||||
elif job_state == JOB_ADMIN_DELETED:
|
||||
log.info("(%d) Job deleted by admin while still queued" % job.id)
|
||||
elif job_state in (JOB_USER_OVER_QUOTA,
|
||||
JOB_USER_OVER_TOTAL_WALLTIME):
|
||||
JOB_USER_OVER_TOTAL_WALLTIME):
|
||||
if job_state == JOB_USER_OVER_QUOTA:
|
||||
log.info("(%d) User (%s) is over quota: job paused" % (job.id, job.user_id))
|
||||
else:
|
||||
@@ -400,7 +400,7 @@ class JobHandlerQueue(object):
|
||||
pass # No history, should not happen with an anon user
|
||||
# Check total walltime limits
|
||||
if (state == JOB_READY and
|
||||
"delta" in self.app.job_config.limits.total_walltime):
|
||||
"delta" in self.app.job_config.limits.total_walltime):
|
||||
jobs_to_check = self.sa_session.query(model.Job).filter(
|
||||
model.Job.user_id == job.user.id,
|
||||
model.Job.update_time >= datetime.datetime.now() -
|
||||
@@ -581,8 +581,8 @@ class JobHandlerQueue(object):
|
||||
if self.app.job_config.limits.anonymous_user_concurrent_jobs:
|
||||
count = self.sa_session.query(model.Job).enable_eagerloads(False) \
|
||||
.filter(and_(model.Job.session_id == job.galaxy_session.id,
|
||||
or_(model.Job.state == model.Job.states.RUNNING,
|
||||
model.Job.state == model.Job.states.QUEUED))).count()
|
||||
or_(model.Job.state == model.Job.states.RUNNING,
|
||||
model.Job.state == model.Job.states.QUEUED))).count()
|
||||
if count >= self.app.job_config.limits.anonymous_user_concurrent_jobs:
|
||||
return JOB_WAIT
|
||||
else:
|
||||
@@ -705,7 +705,7 @@ class JobHandlerStopQueue(object):
|
||||
# Fetch all new jobs
|
||||
newly_deleted_jobs = self.sa_session.query(model.Job).enable_eagerloads(False) \
|
||||
.filter((model.Job.state == model.Job.states.DELETED_NEW) &
|
||||
(model.Job.handler == self.app.config.server_name)).all()
|
||||
(model.Job.handler == self.app.config.server_name)).all()
|
||||
for job in newly_deleted_jobs:
|
||||
jobs_to_check.append((job, job.stderr))
|
||||
# Also pull from the queue (in the case of Administrative stopped jobs)
|
||||
@@ -723,7 +723,7 @@ class JobHandlerStopQueue(object):
|
||||
for job, error_msg in jobs_to_check:
|
||||
if (job.state not in
|
||||
(job.states.DELETED_NEW,
|
||||
job.states.DELETED) and
|
||||
job.states.DELETED) and
|
||||
job.finished):
|
||||
# terminated before it got here
|
||||
log.debug('Job %s already finished, not deleting or stopping', job.id)
|
||||
@@ -814,7 +814,7 @@ class DefaultJobDispatcher(object):
|
||||
log.debug("Stopping job %d:", job.get_id())
|
||||
elif(isinstance(job, model.Task)):
|
||||
log.debug("Stopping job %d, task %d"
|
||||
% (job.get_job().get_id(), job.get_id()))
|
||||
% (job.get_job().get_id(), job.get_id()))
|
||||
else:
|
||||
log.debug("Unknown job to stop")
|
||||
|
||||
@@ -827,7 +827,7 @@ class DefaultJobDispatcher(object):
|
||||
log.debug("stopping job %d in %s runner" % (job.get_id(), runner_name))
|
||||
elif (isinstance(job, model.Task)):
|
||||
log.debug("Stopping job %d, task %d in %s runner"
|
||||
% (job.get_job().get_id(), job.get_id(), runner_name))
|
||||
% (job.get_job().get_id(), job.get_id(), runner_name))
|
||||
try:
|
||||
self.job_runners[runner_name].stop_job(job)
|
||||
except KeyError:
|
||||
|
||||
@@ -32,7 +32,7 @@ def check_output(tool, stdout, stderr, tool_exit_code, job):
|
||||
# behavior of just setting an error if there is *anything* on
|
||||
# stderr.
|
||||
if (len(tool.stdio_regexes) > 0 or
|
||||
len(tool.stdio_exit_codes) > 0):
|
||||
len(tool.stdio_exit_codes) > 0):
|
||||
# Check the exit code ranges in the order in which
|
||||
# they were specified. Each exit_code is a StdioExitCode
|
||||
# that includes an applicable range. If the exit code was in
|
||||
@@ -42,7 +42,7 @@ def check_output(tool, stdout, stderr, tool_exit_code, job):
|
||||
if tool_exit_code is not None:
|
||||
for stdio_exit_code in tool.stdio_exit_codes:
|
||||
if (tool_exit_code >= stdio_exit_code.range_start and
|
||||
tool_exit_code <= stdio_exit_code.range_end):
|
||||
tool_exit_code <= stdio_exit_code.range_end):
|
||||
# Tack on a generic description of the code
|
||||
# plus a specific code description. For example,
|
||||
# this might prepend "Job 42: Warning (Out of Memory)\n".
|
||||
@@ -56,9 +56,9 @@ def check_output(tool, stdout, stderr, tool_exit_code, job):
|
||||
log.info("Job %s: %s" % (job.get_id_tag(), tool_msg))
|
||||
stderr = tool_msg + "\n" + stderr
|
||||
max_error_level = max(max_error_level,
|
||||
stdio_exit_code.error_level)
|
||||
stdio_exit_code.error_level)
|
||||
if (max_error_level >=
|
||||
StdioErrorLevel.FATAL):
|
||||
StdioErrorLevel.FATAL):
|
||||
break
|
||||
|
||||
if max_error_level < StdioErrorLevel.FATAL:
|
||||
@@ -80,30 +80,30 @@ def check_output(tool, stdout, stderr, tool_exit_code, job):
|
||||
# TODO: Collapse this into a single function.
|
||||
if (regex.stdout_match):
|
||||
regex_match = re.search(regex.match, stdout,
|
||||
re.IGNORECASE)
|
||||
re.IGNORECASE)
|
||||
if (regex_match):
|
||||
rexmsg = __regex_err_msg(regex_match, regex)
|
||||
log.info("Job %s: %s"
|
||||
% (job.get_id_tag(), rexmsg))
|
||||
% (job.get_id_tag(), rexmsg))
|
||||
stdout = rexmsg + "\n" + stdout
|
||||
max_error_level = max(max_error_level,
|
||||
regex.error_level)
|
||||
regex.error_level)
|
||||
if (max_error_level >=
|
||||
StdioErrorLevel.FATAL):
|
||||
StdioErrorLevel.FATAL):
|
||||
break
|
||||
|
||||
if (regex.stderr_match):
|
||||
regex_match = re.search(regex.match, stderr,
|
||||
re.IGNORECASE)
|
||||
re.IGNORECASE)
|
||||
if (regex_match):
|
||||
rexmsg = __regex_err_msg(regex_match, regex)
|
||||
log.info("Job %s: %s"
|
||||
% (job.get_id_tag(), rexmsg))
|
||||
% (job.get_id_tag(), rexmsg))
|
||||
stderr = rexmsg + "\n" + stderr
|
||||
max_error_level = max(max_error_level,
|
||||
regex.error_level)
|
||||
regex.error_level)
|
||||
if (max_error_level >=
|
||||
StdioErrorLevel.FATAL):
|
||||
StdioErrorLevel.FATAL):
|
||||
break
|
||||
|
||||
# If we encountered a fatal error, then we'll need to set the
|
||||
@@ -132,7 +132,7 @@ def check_output(tool, stdout, stderr, tool_exit_code, job):
|
||||
except:
|
||||
tb = traceback.format_exc()
|
||||
log.warning("Tool check encountered unexpected exception; " +
|
||||
"assuming tool was successful: " + tb)
|
||||
"assuming tool was successful: " + tb)
|
||||
success = True
|
||||
|
||||
# Store the modified stdout and stderr in the job:
|
||||
|
||||
@@ -196,7 +196,7 @@ class BaseJobRunner(object):
|
||||
raise NotImplementedError()
|
||||
|
||||
def build_command_line(self, job_wrapper, include_metadata=False, include_work_dir_outputs=True,
|
||||
modify_command_for_container=True):
|
||||
modify_command_for_container=True):
|
||||
container = self._find_container(job_wrapper)
|
||||
if not container and job_wrapper.requires_containerization:
|
||||
raise Exception("Failed to find a container when required, contact Galaxy admin.")
|
||||
@@ -273,10 +273,10 @@ class BaseJobRunner(object):
|
||||
lib_adjust = GALAXY_LIB_ADJUST_TEMPLATE % job_wrapper.galaxy_lib_dir
|
||||
venv = GALAXY_VENV_TEMPLATE % job_wrapper.galaxy_virtual_env
|
||||
external_metadata_script = job_wrapper.setup_external_metadata(output_fnames=job_wrapper.get_output_fnames(),
|
||||
set_extension=True,
|
||||
tmp_dir=job_wrapper.working_directory,
|
||||
# We don't want to overwrite metadata that was copied over in init_meta(), as per established behavior
|
||||
kwds={'overwrite' : False})
|
||||
set_extension=True,
|
||||
tmp_dir=job_wrapper.working_directory,
|
||||
# We don't want to overwrite metadata that was copied over in init_meta(), as per established behavior
|
||||
kwds={'overwrite' : False})
|
||||
external_metadata_script = "%s %s %s" % (lib_adjust, venv, external_metadata_script)
|
||||
if resolve_requirements:
|
||||
dependency_shell_commands = self.app.datatypes_registry.set_external_metadata_tool.build_dependency_shell_commands(job_directory=job_wrapper.working_directory)
|
||||
@@ -286,10 +286,10 @@ class BaseJobRunner(object):
|
||||
external_metadata_script = "%s&&%s" % (dependency_shell_commands, external_metadata_script)
|
||||
log.debug('executing external set_meta script for job %d: %s' % (job_wrapper.job_id, external_metadata_script))
|
||||
external_metadata_proc = subprocess.Popen(args=external_metadata_script,
|
||||
shell=True,
|
||||
cwd=job_wrapper.working_directory,
|
||||
env=os.environ,
|
||||
preexec_fn=os.setpgrp)
|
||||
shell=True,
|
||||
cwd=job_wrapper.working_directory,
|
||||
env=os.environ,
|
||||
preexec_fn=os.setpgrp)
|
||||
job_wrapper.external_output_metadata.set_job_runner_external_pid(external_metadata_proc.pid, self.sa_session)
|
||||
external_metadata_proc.wait()
|
||||
log.debug('execution of external set_meta for job %d finished' % job_wrapper.job_id)
|
||||
|
||||
@@ -92,12 +92,12 @@ class LocalJobRunner(BaseJobRunner):
|
||||
stderr_file = tempfile.NamedTemporaryFile(suffix='_stderr', dir=job_wrapper.working_directory)
|
||||
log.debug('(%s) executing job script: %s' % (job_id, command_line))
|
||||
proc = subprocess.Popen(args=command_line,
|
||||
shell=True,
|
||||
cwd=job_wrapper.working_directory,
|
||||
stdout=stdout_file,
|
||||
stderr=stderr_file,
|
||||
env=self._environ,
|
||||
preexec_fn=os.setpgrp)
|
||||
shell=True,
|
||||
cwd=job_wrapper.working_directory,
|
||||
stdout=stdout_file,
|
||||
stderr=stderr_file,
|
||||
env=self._environ,
|
||||
preexec_fn=os.setpgrp)
|
||||
job_wrapper.set_job_destination(job_wrapper.job_destination, proc.pid)
|
||||
job_wrapper.change_state(model.Job.states.RUNNING)
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
return
|
||||
pbs.pbs_deljob(c, job_id, '')
|
||||
log.debug("%s Removed from PBS queue before job completion"
|
||||
% job_tag)
|
||||
% job_tag)
|
||||
except:
|
||||
e = traceback.format_exc()
|
||||
log.debug("%s Unable to stop job: %s" % (job_tag, e))
|
||||
|
||||
@@ -478,10 +478,10 @@ class PulsarJobRunner(AsynchronousJobRunner):
|
||||
cleanup_job = job_wrapper.cleanup_job
|
||||
client_outputs = self.__client_outputs(client, job_wrapper)
|
||||
finish_args = dict(client=client,
|
||||
job_completed_normally=completed_normally,
|
||||
cleanup_job=cleanup_job,
|
||||
client_outputs=client_outputs,
|
||||
pulsar_outputs=pulsar_outputs)
|
||||
job_completed_normally=completed_normally,
|
||||
cleanup_job=cleanup_job,
|
||||
client_outputs=client_outputs,
|
||||
pulsar_outputs=pulsar_outputs)
|
||||
failed = pulsar_finish_job(**finish_args)
|
||||
if failed:
|
||||
job_wrapper.fail("Failed to find or download one or more job outputs from remote server.", exception=True)
|
||||
|
||||
@@ -76,8 +76,8 @@ class TaskedJobRunner(BaseJobRunner):
|
||||
# sleep/loop until no more progress can be made. That is when
|
||||
# all tasks are one of { OK, ERROR, DELETED }. If a task
|
||||
completed_states = [model.Task.states.OK,
|
||||
model.Task.states.ERROR,
|
||||
model.Task.states.DELETED]
|
||||
model.Task.states.ERROR,
|
||||
model.Task.states.DELETED]
|
||||
|
||||
# TODO: Should we report an error (and not merge outputs) if
|
||||
# one of the subtasks errored out? Should we prevent any that
|
||||
@@ -97,7 +97,7 @@ class TaskedJobRunner(BaseJobRunner):
|
||||
if (model.Task.states.ERROR == task_state):
|
||||
job_exit_code = tw.get_exit_code()
|
||||
log.debug("Canceling job %d: Task %s returned an error"
|
||||
% (tw.job_id, tw.task_id))
|
||||
% (tw.job_id, tw.task_id))
|
||||
self._cancel_job(job_wrapper, task_wrappers)
|
||||
tasks_complete = True
|
||||
break
|
||||
@@ -188,7 +188,7 @@ class TaskedJobRunner(BaseJobRunner):
|
||||
task_state = task.get_state()
|
||||
if (model.Task.states.QUEUED == task_state):
|
||||
log.debug("_cancel_job for job %d: Task %d is not running; setting state to DELETED"
|
||||
% (job.get_id(), task.get_id()))
|
||||
% (job.get_id(), task.get_id()))
|
||||
task_wrapper.change_state(task.states.DELETED)
|
||||
# If a task failed, then the caller will have waited a few seconds
|
||||
# before recognizing the failure. In that time, a queued task could
|
||||
@@ -200,7 +200,7 @@ class TaskedJobRunner(BaseJobRunner):
|
||||
if (model.Task.states.RUNNING == task_wrapper.get_state()):
|
||||
task = task_wrapper.get_task()
|
||||
log.debug("_cancel_job for job %d: Stopping running task %d"
|
||||
% (job.get_id(), task.get_id()))
|
||||
% (job.get_id(), task.get_id()))
|
||||
job_wrapper.app.job_manager.job_handler.dispatcher.stop(task)
|
||||
|
||||
def _check_pid(self, pid):
|
||||
|
||||
@@ -147,10 +147,10 @@ def get_object(trans, id, class_name, check_ownership=False, check_accessible=Fa
|
||||
security_check(trans, item, check_ownership, check_accessible)
|
||||
if deleted is True and not item.deleted:
|
||||
raise exceptions.ItemDeletionException('%s "%s" is not deleted'
|
||||
% (class_name, getattr(item, 'name', id)), type="warning")
|
||||
% (class_name, getattr(item, 'name', id)), type="warning")
|
||||
elif deleted is False and item.deleted:
|
||||
raise exceptions.ItemDeletionException('%s "%s" is deleted'
|
||||
% (class_name, getattr(item, 'name', id)), type="warning")
|
||||
% (class_name, getattr(item, 'name', id)), type="warning")
|
||||
return item
|
||||
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ class DatasetCollectionManager(object):
|
||||
self.ldda_manager = lddas.LDDAManager(app)
|
||||
|
||||
def create(self, trans, parent, name, collection_type, element_identifiers=None,
|
||||
elements=None, implicit_collection_info=None, trusted_identifiers=None,
|
||||
hide_source_items=False, tags=None):
|
||||
elements=None, implicit_collection_info=None, trusted_identifiers=None,
|
||||
hide_source_items=False, tags=None):
|
||||
"""
|
||||
PRECONDITION: security checks on ability to add to parent
|
||||
occurred during load.
|
||||
@@ -109,7 +109,7 @@ class DatasetCollectionManager(object):
|
||||
return self.__persist(dataset_collection_instance)
|
||||
|
||||
def create_dataset_collection(self, trans, collection_type, element_identifiers=None, elements=None,
|
||||
hide_source_items=None):
|
||||
hide_source_items=None):
|
||||
if element_identifiers is None and elements is None:
|
||||
raise RequestParameterInvalidException(ERROR_INVALID_ELEMENTS_SPECIFICATION)
|
||||
if not collection_type:
|
||||
|
||||
@@ -271,8 +271,8 @@ class DatasetDeserializer(base.ModelDeserializer, deletable.PurgableDeserializer
|
||||
|
||||
# ============================================================================= AKA DatasetInstanceManager
|
||||
class DatasetAssociationManager(base.ModelManager,
|
||||
secured.AccessibleManagerMixin,
|
||||
deletable.PurgableManagerMixin):
|
||||
secured.AccessibleManagerMixin,
|
||||
deletable.PurgableManagerMixin):
|
||||
"""
|
||||
DatasetAssociation/DatasetInstances are intended to be working
|
||||
proxies to a Dataset, associated with either a library or a
|
||||
@@ -363,7 +363,7 @@ class DatasetAssociationManager(base.ModelManager,
|
||||
|
||||
|
||||
class _UnflattenedMetadataDatasetAssociationSerializer(base.ModelSerializer,
|
||||
deletable.PurgableSerializerMixin):
|
||||
deletable.PurgableSerializerMixin):
|
||||
|
||||
def __init__(self, app):
|
||||
self.dataset_serializer = DatasetSerializer(app)
|
||||
@@ -442,10 +442,10 @@ class _UnflattenedMetadataDatasetAssociationSerializer(base.ModelSerializer,
|
||||
if isinstance(dataset_assoc.metadata.spec[meta_type].param, galaxy.datatypes.metadata.FileParameter):
|
||||
meta_files.append(
|
||||
dict(file_type=meta_type,
|
||||
download_url=self.url_for('history_contents_metadata_file',
|
||||
history_id=self.app.security.encode_id(dataset_assoc.history_id),
|
||||
history_content_id=self.app.security.encode_id(dataset_assoc.id),
|
||||
metadata_file=meta_type)))
|
||||
download_url=self.url_for('history_contents_metadata_file',
|
||||
history_id=self.app.security.encode_id(dataset_assoc.history_id),
|
||||
history_content_id=self.app.security.encode_id(dataset_assoc.id),
|
||||
metadata_file=meta_type)))
|
||||
return meta_files
|
||||
|
||||
def serialize_metadata(self, dataset_assoc, key, excluded=None, **context):
|
||||
|
||||
@@ -223,8 +223,8 @@ class FolderManager(object):
|
||||
manage_folder_role_list = [(manage_role.name, trans.security.encode_id(manage_role.id)) for manage_role in manage_roles]
|
||||
add_library_item_role_list = [(add_role.name, trans.security.encode_id(add_role.id)) for add_role in add_roles]
|
||||
return dict(modify_folder_role_list=modify_folder_role_list,
|
||||
manage_folder_role_list=manage_folder_role_list,
|
||||
add_library_item_role_list=add_library_item_role_list)
|
||||
manage_folder_role_list=manage_folder_role_list,
|
||||
add_library_item_role_list=add_library_item_role_list)
|
||||
|
||||
def can_add_item(self, trans, folder):
|
||||
"""
|
||||
|
||||
+20
-20
@@ -22,9 +22,9 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class HDAManager(datasets.DatasetAssociationManager,
|
||||
secured.OwnableManagerMixin,
|
||||
taggable.TaggableManagerMixin,
|
||||
annotatable.AnnotatableManagerMixin):
|
||||
secured.OwnableManagerMixin,
|
||||
taggable.TaggableManagerMixin,
|
||||
annotatable.AnnotatableManagerMixin):
|
||||
"""
|
||||
Interface/service object for interacting with HDAs.
|
||||
"""
|
||||
@@ -83,7 +83,7 @@ class HDAManager(datasets.DatasetAssociationManager,
|
||||
if not dataset:
|
||||
kwargs['create_dataset'] = True
|
||||
hda = model.HistoryDatasetAssociation(history=history, dataset=dataset,
|
||||
sa_session=self.app.model.context, **kwargs)
|
||||
sa_session=self.app.model.context, **kwargs)
|
||||
|
||||
if history:
|
||||
history.add_dataset(hda, set_hid=('hid' not in kwargs))
|
||||
@@ -179,7 +179,7 @@ class HDAManager(datasets.DatasetAssociationManager,
|
||||
"""
|
||||
job_states = model.Job.states
|
||||
query = (self._job_state_history_query(hda)
|
||||
.filter(model.JobStateHistory.state == job_states.RESUBMITTED))
|
||||
.filter(model.JobStateHistory.state == job_states.RESUBMITTED))
|
||||
return self.app.model.context.query(query.exists()).scalar()
|
||||
|
||||
def _job_state_history_query(self, hda):
|
||||
@@ -194,9 +194,9 @@ class HDAManager(datasets.DatasetAssociationManager,
|
||||
# NOTE: don't eagerload (JODA will load the hda were using!)
|
||||
hda_id = hda.id
|
||||
query = (session.query(JobToOutputDatasetAssociation, JobStateHistory)
|
||||
.filter(JobToOutputDatasetAssociation.dataset_id == hda_id)
|
||||
.filter(JobStateHistory.job_id == JobToOutputDatasetAssociation.job_id)
|
||||
.enable_eagerloads(False))
|
||||
.filter(JobToOutputDatasetAssociation.dataset_id == hda_id)
|
||||
.filter(JobStateHistory.job_id == JobToOutputDatasetAssociation.job_id)
|
||||
.enable_eagerloads(False))
|
||||
return query
|
||||
|
||||
def data_conversion_status(self, hda):
|
||||
@@ -341,14 +341,14 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
|
||||
# see also: https://trello.com/c/5d6j4X5y
|
||||
# see also: https://sentry.galaxyproject.org/galaxy/galaxy-main/group/20769/events/9352883/
|
||||
'url' : lambda i, k, **c: self.url_for('history_content',
|
||||
history_id=self.app.security.encode_id(i.history_id),
|
||||
id=self.app.security.encode_id(i.id)),
|
||||
history_id=self.app.security.encode_id(i.history_id),
|
||||
id=self.app.security.encode_id(i.id)),
|
||||
'urls' : self.serialize_urls,
|
||||
|
||||
# TODO: backwards compat: need to go away
|
||||
'download_url' : lambda i, k, **c: self.url_for('history_contents_display',
|
||||
history_id=self.app.security.encode_id(i.history.id),
|
||||
history_content_id=self.app.security.encode_id(i.id)),
|
||||
history_id=self.app.security.encode_id(i.history.id),
|
||||
history_content_id=self.app.security.encode_id(i.id)),
|
||||
'parent_id' : self.serialize_id,
|
||||
# TODO: to DatasetAssociationSerializer
|
||||
'accessible' : lambda i, k, user=None, **c: self.manager.is_accessible(i, user),
|
||||
@@ -432,21 +432,21 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
|
||||
'display' : url_for(controller='dataset', action='display', dataset_id=encoded_id, preview=True),
|
||||
'edit' : url_for(controller='dataset', action='edit', dataset_id=encoded_id),
|
||||
'download' : url_for(controller='dataset', action='display',
|
||||
dataset_id=encoded_id, to_ext=hda.extension),
|
||||
dataset_id=encoded_id, to_ext=hda.extension),
|
||||
'report_error' : url_for(controller='dataset', action='errors', id=encoded_id),
|
||||
'rerun' : url_for(controller='tool_runner', action='rerun', id=encoded_id),
|
||||
'show_params' : url_for(controller='dataset', action='show_params', dataset_id=encoded_id),
|
||||
'visualization' : url_for(controller='visualization', action='index',
|
||||
id=encoded_id, model='HistoryDatasetAssociation'),
|
||||
id=encoded_id, model='HistoryDatasetAssociation'),
|
||||
'meta_download' : url_for(controller='dataset', action='get_metadata_file',
|
||||
hda_id=encoded_id, metadata_name=''),
|
||||
hda_id=encoded_id, metadata_name=''),
|
||||
}
|
||||
return urls
|
||||
|
||||
|
||||
class HDADeserializer(datasets.DatasetAssociationDeserializer,
|
||||
taggable.TaggableDeserializerMixin,
|
||||
annotatable.AnnotatableDeserializerMixin):
|
||||
taggable.TaggableDeserializerMixin,
|
||||
annotatable.AnnotatableDeserializerMixin):
|
||||
"""
|
||||
Interface/service object for validating and deserializing dictionaries into histories.
|
||||
"""
|
||||
@@ -466,14 +466,14 @@ class HDADeserializer(datasets.DatasetAssociationDeserializer,
|
||||
# remapped
|
||||
'genome_build' : lambda i, k, v, **c: self.deserialize_genome_build(i, 'dbkey', v),
|
||||
'misc_info' : lambda i, k, v, **c: self.deserialize_basestring(i, 'info', v,
|
||||
convert_none_to_empty=True),
|
||||
convert_none_to_empty=True),
|
||||
})
|
||||
self.deserializable_keyset.update(self.deserializers.keys())
|
||||
|
||||
|
||||
class HDAFilterParser(datasets.DatasetAssociationFilterParser,
|
||||
taggable.TaggableFilterMixin,
|
||||
annotatable.AnnotatableFilterMixin):
|
||||
taggable.TaggableFilterMixin,
|
||||
annotatable.AnnotatableFilterMixin):
|
||||
model_manager_class = HDAManager
|
||||
model_class = model.HistoryDatasetAssociation
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ class HDCASerializer(
|
||||
'type_id' : self.serialize_type_id,
|
||||
|
||||
'url' : lambda i, k, **c: self.url_for('history_content_typed',
|
||||
history_id=self.app.security.encode_id(i.history_id),
|
||||
id=self.app.security.encode_id(i.id),
|
||||
type=self.hdca_manager.model_class.content_type),
|
||||
history_id=self.app.security.encode_id(i.history_id),
|
||||
id=self.app.security.encode_id(i.id),
|
||||
type=self.hdca_manager.model_class.content_type),
|
||||
})
|
||||
|
||||
@@ -242,7 +242,7 @@ class HistorySerializer(sharable.SharableModelSerializer, deletable.PurgableSeri
|
||||
|
||||
'url' : lambda i, k, **c: self.url_for('history', id=self.app.security.encode_id(i.id)),
|
||||
'contents_url' : lambda i, k, **c: self.url_for('history_contents',
|
||||
history_id=self.app.security.encode_id(i.id)),
|
||||
history_id=self.app.security.encode_id(i.id)),
|
||||
|
||||
'empty' : lambda i, k, **c: (len(i.datasets) + len(i.dataset_collections)) <= 0,
|
||||
'count' : lambda i, k, **c: len(i.datasets),
|
||||
@@ -251,7 +251,7 @@ class HistorySerializer(sharable.SharableModelSerializer, deletable.PurgableSeri
|
||||
'state_ids' : self.serialize_state_ids,
|
||||
'contents' : self.serialize_contents,
|
||||
'non_ready_jobs': lambda i, k, **c: [self.app.security.encode_id(job.id) for job
|
||||
in self.manager.non_ready_jobs(i)],
|
||||
in self.manager.non_ready_jobs(i)],
|
||||
|
||||
'contents_states': self.serialize_contents_states,
|
||||
'contents_active': self.serialize_contents_active,
|
||||
|
||||
@@ -14,6 +14,6 @@ class LDDAManager(object):
|
||||
|
||||
def get(self, trans, id, check_accessible=True):
|
||||
return manager_base.get_object(trans, id,
|
||||
'LibraryDatasetDatasetAssociation',
|
||||
check_ownership=False,
|
||||
check_accessible=check_accessible)
|
||||
'LibraryDatasetDatasetAssociation',
|
||||
check_ownership=False,
|
||||
check_accessible=check_accessible)
|
||||
|
||||
@@ -211,9 +211,9 @@ class LibraryManager(object):
|
||||
manage_library_role_list = [(manage_role.name, trans.security.encode_id(manage_role.id)) for manage_role in self.get_manage_roles(trans, library)]
|
||||
add_library_item_role_list = [(add_role.name, trans.security.encode_id(add_role.id)) for add_role in self.get_add_roles(trans, library)]
|
||||
return dict(access_library_role_list=access_library_role_list,
|
||||
modify_library_role_list=modify_library_role_list,
|
||||
manage_library_role_list=manage_library_role_list,
|
||||
add_library_item_role_list=add_library_item_role_list)
|
||||
modify_library_role_list=modify_library_role_list,
|
||||
manage_library_role_list=manage_library_role_list,
|
||||
add_library_item_role_list=add_library_item_role_list)
|
||||
|
||||
def get_access_roles(self, trans, library):
|
||||
"""
|
||||
|
||||
@@ -231,9 +231,9 @@ class AccessDatasetRBACPermission(DatasetRBACPermission):
|
||||
# NOTE: that because of short circuiting this allows
|
||||
# anonymous access to public datasets
|
||||
return (self._is_public_based_on_roles(current_roles) or
|
||||
# admin is always permitted
|
||||
self.user_manager.is_admin(user) or
|
||||
self._user_has_all_roles(user, current_roles))
|
||||
# admin is always permitted
|
||||
self.user_manager.is_admin(user) or
|
||||
self._user_has_all_roles(user, current_roles))
|
||||
|
||||
def grant(self, item, user):
|
||||
pass
|
||||
@@ -267,5 +267,5 @@ class AccessDatasetRBACPermission(DatasetRBACPermission):
|
||||
def _role_is_permitted(self, dataset, role):
|
||||
current_roles = self._roles(dataset)
|
||||
return (self._is_public_based_on_roles(current_roles) or
|
||||
# if there's only one role and this is it, let em in
|
||||
((len(current_roles) == 1) and (role == current_roles[0])))
|
||||
# if there's only one role and this is it, let em in
|
||||
((len(current_roles) == 1) and (role == current_roles[0])))
|
||||
|
||||
@@ -39,7 +39,7 @@ class RoleManager(base.ModelManager):
|
||||
"""
|
||||
try:
|
||||
role = (self.session().query(self.model_class)
|
||||
.filter(self.model_class.id == decoded_role_id).one())
|
||||
.filter(self.model_class.id == decoded_role_id).one())
|
||||
except sqlalchemy_exceptions.MultipleResultsFound:
|
||||
raise galaxy.exceptions.InconsistentDatabase('Multiple roles found with the same id.')
|
||||
except sqlalchemy_exceptions.NoResultFound:
|
||||
|
||||
@@ -247,12 +247,12 @@ class SharableModelManager(base.ModelManager, secured.OwnableManagerMixin, secur
|
||||
|
||||
def _existing_set_of_slugs(self, user):
|
||||
query = (self.session().query(self.model_class.slug)
|
||||
.filter_by(user=user))
|
||||
.filter_by(user=user))
|
||||
return list(set(query.all()))
|
||||
|
||||
def _slug_exists(self, user, slug):
|
||||
query = (self.session().query(self.model_class.slug)
|
||||
.filter_by(user=user, slug=slug))
|
||||
.filter_by(user=user, slug=slug))
|
||||
return query.count() != 0
|
||||
|
||||
def _slugify(self, start_with):
|
||||
@@ -289,8 +289,8 @@ class SharableModelManager(base.ModelManager, secured.OwnableManagerMixin, secur
|
||||
new_slug = slug_base
|
||||
count = 1
|
||||
while (self.session().query(item.__class__)
|
||||
.filter_by(user=item.user, slug=new_slug, importable=True)
|
||||
.count() != 0):
|
||||
.filter_by(user=item.user, slug=new_slug, importable=True)
|
||||
.count() != 0):
|
||||
# Slug taken; choose a new slug based on count. This approach can
|
||||
# handle numerous items with the same name gracefully.
|
||||
new_slug = '%s-%i' % (slug_base, count)
|
||||
|
||||
+20
-20
@@ -83,11 +83,11 @@ class TagManager(object):
|
||||
group_by = item_tag_assoc_class.table.c.tag_id
|
||||
# Do query and get result set.
|
||||
query = select(columns=cols_to_select,
|
||||
from_obj=from_obj,
|
||||
whereclause=where_clause,
|
||||
group_by=group_by,
|
||||
order_by=order_by,
|
||||
limit=limit)
|
||||
from_obj=from_obj,
|
||||
whereclause=where_clause,
|
||||
group_by=group_by,
|
||||
order_by=order_by,
|
||||
limit=limit)
|
||||
result_set = self.sa_session.execute(query)
|
||||
# Return community tags.
|
||||
community_tags = []
|
||||
@@ -98,7 +98,7 @@ class TagManager(object):
|
||||
|
||||
def get_tool_tags(self):
|
||||
query = select(columns=[galaxy.model.ToolTagAssociation.table.c.tag_id],
|
||||
from_obj=galaxy.model.ToolTagAssociation.table).distinct()
|
||||
from_obj=galaxy.model.ToolTagAssociation.table).distinct()
|
||||
result_set = self.sa_session.execute(query)
|
||||
|
||||
tags = []
|
||||
@@ -314,29 +314,29 @@ class GalaxyTagManager(TagManager):
|
||||
from galaxy import model
|
||||
TagManager.__init__(self, sa_session)
|
||||
self.item_tag_assoc_info["History"] = ItemTagAssocInfo(model.History,
|
||||
model.HistoryTagAssociation,
|
||||
model.HistoryTagAssociation.table.c.history_id)
|
||||
model.HistoryTagAssociation,
|
||||
model.HistoryTagAssociation.table.c.history_id)
|
||||
self.item_tag_assoc_info["HistoryDatasetAssociation"] = \
|
||||
ItemTagAssocInfo(model.HistoryDatasetAssociation,
|
||||
model.HistoryDatasetAssociationTagAssociation,
|
||||
model.HistoryDatasetAssociationTagAssociation.table.c.history_dataset_association_id)
|
||||
model.HistoryDatasetAssociationTagAssociation,
|
||||
model.HistoryDatasetAssociationTagAssociation.table.c.history_dataset_association_id)
|
||||
self.item_tag_assoc_info["HistoryDatasetCollectionAssociation"] = \
|
||||
ItemTagAssocInfo(model.HistoryDatasetCollectionAssociation,
|
||||
model.HistoryDatasetCollectionTagAssociation,
|
||||
model.HistoryDatasetCollectionTagAssociation.table.c.history_dataset_collection_id)
|
||||
model.HistoryDatasetCollectionTagAssociation,
|
||||
model.HistoryDatasetCollectionTagAssociation.table.c.history_dataset_collection_id)
|
||||
self.item_tag_assoc_info["LibraryDatasetDatasetAssociation"] = \
|
||||
ItemTagAssocInfo(model.LibraryDatasetDatasetAssociation,
|
||||
model.LibraryDatasetDatasetAssociationTagAssociation,
|
||||
model.LibraryDatasetDatasetAssociationTagAssociation.table.c.library_dataset_dataset_association_id)
|
||||
model.LibraryDatasetDatasetAssociationTagAssociation,
|
||||
model.LibraryDatasetDatasetAssociationTagAssociation.table.c.library_dataset_dataset_association_id)
|
||||
self.item_tag_assoc_info["Page"] = ItemTagAssocInfo(model.Page,
|
||||
model.PageTagAssociation,
|
||||
model.PageTagAssociation.table.c.page_id)
|
||||
model.PageTagAssociation,
|
||||
model.PageTagAssociation.table.c.page_id)
|
||||
self.item_tag_assoc_info["StoredWorkflow"] = ItemTagAssocInfo(model.StoredWorkflow,
|
||||
model.StoredWorkflowTagAssociation,
|
||||
model.StoredWorkflowTagAssociation.table.c.stored_workflow_id)
|
||||
model.StoredWorkflowTagAssociation,
|
||||
model.StoredWorkflowTagAssociation.table.c.stored_workflow_id)
|
||||
self.item_tag_assoc_info["Visualization"] = ItemTagAssocInfo(model.Visualization,
|
||||
model.VisualizationTagAssociation,
|
||||
model.VisualizationTagAssociation.table.c.visualization_id)
|
||||
model.VisualizationTagAssociation,
|
||||
model.VisualizationTagAssociation.table.c.visualization_id)
|
||||
|
||||
|
||||
class CommunityTagManager(TagManager):
|
||||
|
||||
@@ -168,8 +168,8 @@ class UserManager(base.ModelManager, deletable.PurgableManagerMixin):
|
||||
Return this most recent APIKey for this user or None if none have been created.
|
||||
"""
|
||||
query = (self.session().query(model.APIKeys)
|
||||
.filter_by(user=user)
|
||||
.order_by(sqlalchemy.desc(model.APIKeys.create_time)))
|
||||
.filter_by(user=user)
|
||||
.order_by(sqlalchemy.desc(model.APIKeys.create_time)))
|
||||
all = query.all()
|
||||
if len(all):
|
||||
return all[0]
|
||||
@@ -221,7 +221,7 @@ class UserManager(base.ModelManager, deletable.PurgableManagerMixin):
|
||||
all_tags_query = None
|
||||
for tag_model in tag_models:
|
||||
subq = (self.session().query(tag_model.user_tname, tag_model.user_value)
|
||||
.filter(tag_model.user == user))
|
||||
.filter(tag_model.user == user))
|
||||
all_tags_query = subq if all_tags_query is None else all_tags_query.union(subq)
|
||||
|
||||
# if nothing init'd the query, bail
|
||||
|
||||
+250
-250
@@ -437,19 +437,19 @@ class Job(object, JobLike, Dictifiable):
|
||||
_text_metric = JobMetricText
|
||||
|
||||
states = Bunch(NEW='new',
|
||||
RESUBMITTED='resubmitted',
|
||||
UPLOAD='upload',
|
||||
WAITING='waiting',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
ERROR='error',
|
||||
PAUSED='paused',
|
||||
DELETED='deleted',
|
||||
DELETED_NEW='deleted_new')
|
||||
RESUBMITTED='resubmitted',
|
||||
UPLOAD='upload',
|
||||
WAITING='waiting',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
ERROR='error',
|
||||
PAUSED='paused',
|
||||
DELETED='deleted',
|
||||
DELETED_NEW='deleted_new')
|
||||
terminal_states = [states.OK,
|
||||
states.ERROR,
|
||||
states.DELETED]
|
||||
states.ERROR,
|
||||
states.DELETED]
|
||||
#: job states where the job hasn't finished and the model may still change
|
||||
non_ready_states = [
|
||||
states.NEW,
|
||||
@@ -819,12 +819,12 @@ class Task(object, JobLike):
|
||||
_text_metric = TaskMetricText
|
||||
|
||||
states = Bunch(NEW='new',
|
||||
WAITING='waiting',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
ERROR='error',
|
||||
DELETED='deleted')
|
||||
WAITING='waiting',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
ERROR='error',
|
||||
DELETED='deleted')
|
||||
|
||||
# Please include an accessor (get/set pair) for any new columns/members.
|
||||
def __init__(self, job, working_directory, prepare_files_cmd):
|
||||
@@ -960,7 +960,7 @@ class Task(object, JobLike):
|
||||
# differentiate between the kinds of Runnable things (Jobs and Tasks)
|
||||
# that they're using.
|
||||
log.debug("Task %d: Set external id to %s"
|
||||
% (self.id, task_runner_external_id))
|
||||
% (self.id, task_runner_external_id))
|
||||
self.task_runner_external_id = task_runner_external_id
|
||||
|
||||
def set_task_runner_external_id(self, task_runner_external_id):
|
||||
@@ -1083,8 +1083,8 @@ class JobExternalOutputMetadata(object):
|
||||
|
||||
class JobExportHistoryArchive(object):
|
||||
def __init__(self, job=None, history=None, dataset=None, compressed=False,
|
||||
history_attrs_filename=None, datasets_attrs_filename=None,
|
||||
jobs_attrs_filename=None):
|
||||
history_attrs_filename=None, datasets_attrs_filename=None,
|
||||
jobs_attrs_filename=None):
|
||||
self.job = job
|
||||
self.history = history
|
||||
self.dataset = dataset
|
||||
@@ -1129,8 +1129,8 @@ class JobImportHistoryArchive(object):
|
||||
|
||||
class GenomeIndexToolData(object):
|
||||
def __init__(self, job=None, params=None, dataset=None, deferred_job=None,
|
||||
transfer_job=None, fasta_path=None, created_time=None, modified_time=None,
|
||||
dbkey=None, user=None, indexer=None):
|
||||
transfer_job=None, fasta_path=None, created_time=None, modified_time=None,
|
||||
dbkey=None, user=None, indexer=None):
|
||||
self.job = job
|
||||
self.dataset = dataset
|
||||
self.fasta_path = fasta_path
|
||||
@@ -1144,11 +1144,11 @@ class GenomeIndexToolData(object):
|
||||
|
||||
class DeferredJob(object):
|
||||
states = Bunch(NEW='new',
|
||||
WAITING='waiting',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
ERROR='error')
|
||||
WAITING='waiting',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
ERROR='error')
|
||||
|
||||
def __init__(self, state=None, plugin=None, params=None):
|
||||
self.state = state
|
||||
@@ -1209,7 +1209,7 @@ class History(HasTags, Dictifiable, UsesAnnotations, HasName):
|
||||
|
||||
dict_collection_visible_keys = ('id', 'name', 'published', 'deleted')
|
||||
dict_element_visible_keys = ('id', 'name', 'genome_build', 'deleted', 'purged', 'update_time',
|
||||
'published', 'importable', 'slug', 'empty')
|
||||
'published', 'importable', 'slug', 'empty')
|
||||
default_name = 'Unnamed history'
|
||||
|
||||
def __init__(self, id=None, name=None, user=None):
|
||||
@@ -1254,7 +1254,7 @@ class History(HasTags, Dictifiable, UsesAnnotations, HasName):
|
||||
object_session(self).flush()
|
||||
elif not isinstance(dataset, HistoryDatasetAssociation):
|
||||
raise TypeError("You can only add Dataset and HistoryDatasetAssociation instances to a history" +
|
||||
" ( you tried to add %s )." % str(dataset))
|
||||
" ( you tried to add %s )." % str(dataset))
|
||||
if parent_id:
|
||||
for data in self.datasets:
|
||||
if data.id == parent_id:
|
||||
@@ -1475,13 +1475,13 @@ class History(HasTags, Dictifiable, UsesAnnotations, HasName):
|
||||
if not hasattr(self, '_active_datasets_and_roles'):
|
||||
db_session = object_session(self)
|
||||
query = (db_session.query(HistoryDatasetAssociation)
|
||||
.filter(HistoryDatasetAssociation.table.c.history_id == self.id)
|
||||
.filter(not_(HistoryDatasetAssociation.deleted))
|
||||
.order_by(HistoryDatasetAssociation.table.c.hid.asc())
|
||||
.options(joinedload("dataset"),
|
||||
joinedload("dataset.actions"),
|
||||
joinedload("dataset.actions.role"),
|
||||
joinedload("tags"),
|
||||
.filter(HistoryDatasetAssociation.table.c.history_id == self.id)
|
||||
.filter(not_(HistoryDatasetAssociation.deleted))
|
||||
.order_by(HistoryDatasetAssociation.table.c.hid.asc())
|
||||
.options(joinedload("dataset"),
|
||||
joinedload("dataset.actions"),
|
||||
joinedload("dataset.actions.role"),
|
||||
joinedload("tags"),
|
||||
))
|
||||
self._active_datasets_and_roles = query.all()
|
||||
return self._active_datasets_and_roles
|
||||
@@ -1712,16 +1712,16 @@ class StorableObject(object):
|
||||
|
||||
class Dataset(StorableObject):
|
||||
states = Bunch(NEW='new',
|
||||
UPLOAD='upload',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
EMPTY='empty',
|
||||
ERROR='error',
|
||||
DISCARDED='discarded',
|
||||
PAUSED='paused',
|
||||
SETTING_METADATA='setting_metadata',
|
||||
FAILED_METADATA='failed_metadata')
|
||||
UPLOAD='upload',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
EMPTY='empty',
|
||||
ERROR='error',
|
||||
DISCARDED='discarded',
|
||||
PAUSED='paused',
|
||||
SETTING_METADATA='setting_metadata',
|
||||
FAILED_METADATA='failed_metadata')
|
||||
# failed_metadata is only valid as DatasetInstance state currently
|
||||
|
||||
non_ready_states = (
|
||||
@@ -1744,13 +1744,13 @@ class Dataset(StorableObject):
|
||||
)
|
||||
|
||||
conversion_messages = Bunch(PENDING="pending",
|
||||
NO_DATA="no data",
|
||||
NO_CHROMOSOME="no chromosome",
|
||||
NO_CONVERTER="no converter",
|
||||
NO_TOOL="no tool",
|
||||
DATA="data",
|
||||
ERROR="error",
|
||||
OK="ok")
|
||||
NO_DATA="no data",
|
||||
NO_CHROMOSOME="no chromosome",
|
||||
NO_CONVERTER="no converter",
|
||||
NO_TOOL="no tool",
|
||||
DATA="data",
|
||||
ERROR="error",
|
||||
OK="ok")
|
||||
|
||||
permitted_actions = get_permitted_actions(filter='DATASET')
|
||||
file_path = "/tmp/"
|
||||
@@ -1919,9 +1919,9 @@ class DatasetInstance(object):
|
||||
permitted_actions = Dataset.permitted_actions
|
||||
|
||||
def __init__(self, id=None, hid=None, name=None, info=None, blurb=None, peek=None, tool_version=None, extension=None,
|
||||
dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None,
|
||||
parent_id=None, validation_errors=None, visible=True, create_dataset=False, sa_session=None,
|
||||
extended_metadata=None, flush=True):
|
||||
dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None,
|
||||
parent_id=None, validation_errors=None, visible=True, create_dataset=False, sa_session=None,
|
||||
extended_metadata=None, flush=True):
|
||||
self.name = name or "Unnamed dataset"
|
||||
self.id = id
|
||||
self.info = info
|
||||
@@ -2245,8 +2245,8 @@ class DatasetInstance(object):
|
||||
Return true if the dataset is neither ready nor in error
|
||||
"""
|
||||
return self.state in (self.states.NEW, self.states.UPLOAD,
|
||||
self.states.QUEUED, self.states.RUNNING,
|
||||
self.states.SETTING_METADATA)
|
||||
self.states.QUEUED, self.states.RUNNING,
|
||||
self.states.SETTING_METADATA)
|
||||
|
||||
@property
|
||||
def source_library_dataset(self):
|
||||
@@ -2367,18 +2367,18 @@ class DatasetInstance(object):
|
||||
|
||||
|
||||
class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnotations,
|
||||
HasName):
|
||||
HasName):
|
||||
"""
|
||||
Resource class that creates a relation between a dataset and a user history.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
hid=None,
|
||||
history=None,
|
||||
copied_from_history_dataset_association=None,
|
||||
copied_from_library_dataset_dataset_association=None,
|
||||
sa_session=None,
|
||||
**kwd):
|
||||
hid=None,
|
||||
history=None,
|
||||
copied_from_history_dataset_association=None,
|
||||
copied_from_library_dataset_dataset_association=None,
|
||||
sa_session=None,
|
||||
**kwd):
|
||||
"""
|
||||
Create a a new HDA and associate it with the given history.
|
||||
"""
|
||||
@@ -2396,18 +2396,18 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
Create a copy of this HDA.
|
||||
"""
|
||||
hda = HistoryDatasetAssociation(hid=self.hid,
|
||||
name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_history_dataset_association=self)
|
||||
name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_history_dataset_association=self)
|
||||
# update init non-keywords as well
|
||||
hda.purged = self.purged
|
||||
|
||||
@@ -2429,7 +2429,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
new_dataset.hid = self.hid
|
||||
|
||||
def to_library_dataset_dataset_association(self, trans, target_folder, replace_dataset=None,
|
||||
parent_id=None, user=None, roles=None, ldda_message='', element_identifier=None):
|
||||
parent_id=None, user=None, roles=None, ldda_message='', element_identifier=None):
|
||||
"""
|
||||
Copy this HDA to a library optionally replacing an existing LDDA.
|
||||
"""
|
||||
@@ -2448,26 +2448,26 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
# This should never happen since users must be authenticated to upload to a data library
|
||||
user = self.history.user
|
||||
ldda = LibraryDatasetDatasetAssociation(name=element_identifier or self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
library_dataset=library_dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_history_dataset_association=self,
|
||||
user=user)
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
library_dataset=library_dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_history_dataset_association=self,
|
||||
user=user)
|
||||
object_session(self).add(ldda)
|
||||
object_session(self).flush()
|
||||
# If roles were selected on the upload form, restrict access to the Dataset to those roles
|
||||
roles = roles or []
|
||||
for role in roles:
|
||||
dp = trans.model.DatasetPermissions(trans.app.security_agent.permitted_actions.DATASET_ACCESS.action,
|
||||
ldda.dataset, role)
|
||||
ldda.dataset, role)
|
||||
trans.sa_session.add(dp)
|
||||
trans.sa_session.flush()
|
||||
# Must set metadata after ldda flushed, as MetadataFiles require ldda.id
|
||||
@@ -2484,10 +2484,10 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
object_session(self).flush()
|
||||
for child in self.children:
|
||||
child.to_library_dataset_dataset_association(trans,
|
||||
target_folder=target_folder,
|
||||
replace_dataset=replace_dataset,
|
||||
parent_id=ldda.id,
|
||||
user=ldda.user)
|
||||
target_folder=target_folder,
|
||||
replace_dataset=replace_dataset,
|
||||
parent_id=ldda.id,
|
||||
user=ldda.user)
|
||||
if not self.datatype.copy_safe_peek:
|
||||
# In some instances peek relies on dataset_id, i.e. gmaj.zip for viewing MAFs
|
||||
ldda.set_peek()
|
||||
@@ -2545,25 +2545,25 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
original_rval = super(HistoryDatasetAssociation, self).to_dict(view=view)
|
||||
hda = self
|
||||
rval = dict(id=hda.id,
|
||||
hda_ldda='hda',
|
||||
uuid=(lambda uuid: str(uuid) if uuid else None)(hda.dataset.uuid),
|
||||
hid=hda.hid,
|
||||
file_ext=hda.ext,
|
||||
peek=(lambda hda: hda.display_peek() if hda.peek and hda.peek != 'no peek' else None)(hda),
|
||||
model_class=self.__class__.__name__,
|
||||
name=hda.name,
|
||||
deleted=hda.deleted,
|
||||
purged=hda.purged,
|
||||
visible=hda.visible,
|
||||
state=hda.state,
|
||||
history_content_type=hda.history_content_type,
|
||||
file_size=int(hda.get_size()),
|
||||
create_time=hda.create_time.isoformat(),
|
||||
update_time=hda.update_time.isoformat(),
|
||||
data_type=hda.datatype.__class__.__module__ + '.' + hda.datatype.__class__.__name__,
|
||||
genome_build=hda.dbkey,
|
||||
misc_info=hda.info.strip() if isinstance(hda.info, string_types) else hda.info,
|
||||
misc_blurb=hda.blurb)
|
||||
hda_ldda='hda',
|
||||
uuid=(lambda uuid: str(uuid) if uuid else None)(hda.dataset.uuid),
|
||||
hid=hda.hid,
|
||||
file_ext=hda.ext,
|
||||
peek=(lambda hda: hda.display_peek() if hda.peek and hda.peek != 'no peek' else None)(hda),
|
||||
model_class=self.__class__.__name__,
|
||||
name=hda.name,
|
||||
deleted=hda.deleted,
|
||||
purged=hda.purged,
|
||||
visible=hda.visible,
|
||||
state=hda.state,
|
||||
history_content_type=hda.history_content_type,
|
||||
file_size=int(hda.get_size()),
|
||||
create_time=hda.create_time.isoformat(),
|
||||
update_time=hda.update_time.isoformat(),
|
||||
data_type=hda.datatype.__class__.__module__ + '.' + hda.datatype.__class__.__name__,
|
||||
genome_build=hda.dbkey,
|
||||
misc_info=hda.info.strip() if isinstance(hda.info, string_types) else hda.info,
|
||||
misc_blurb=hda.blurb)
|
||||
|
||||
rval.update(original_rval)
|
||||
|
||||
@@ -2605,7 +2605,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
@type_id.expression
|
||||
def type_id(cls):
|
||||
return ((type_coerce(cls.content_type, types.Unicode) + u'-' +
|
||||
type_coerce(cls.id, types.Unicode)).label('type_id'))
|
||||
type_coerce(cls.id, types.Unicode)).label('type_id'))
|
||||
|
||||
def copy_tags_from(self, target_user, source_hda):
|
||||
"""
|
||||
@@ -2813,9 +2813,9 @@ class LibraryFolder(object, Dictifiable, HasName):
|
||||
class LibraryDataset(object):
|
||||
# This class acts as a proxy to the currently selected LDDA
|
||||
upload_options = [('upload_file', 'Upload files'),
|
||||
('upload_directory', 'Upload directory of files'),
|
||||
('upload_paths', 'Upload files from filesystem paths'),
|
||||
('import_from_history', 'Import datasets from your current history')]
|
||||
('upload_directory', 'Upload directory of files'),
|
||||
('upload_paths', 'Upload files from filesystem paths'),
|
||||
('import_from_history', 'Import datasets from your current history')]
|
||||
|
||||
def __init__(self, folder=None, order_id=None, name=None, info=None, library_dataset_dataset_association=None, **kwd):
|
||||
self.folder = folder
|
||||
@@ -2872,24 +2872,24 @@ class LibraryDataset(object):
|
||||
template_data[template.name] = tmp_dict
|
||||
|
||||
rval = dict(id=self.id,
|
||||
ldda_id=ldda.id,
|
||||
parent_library_id=self.folder.parent_library.id,
|
||||
folder_id=self.folder_id,
|
||||
model_class=self.__class__.__name__,
|
||||
state=ldda.state,
|
||||
name=ldda.name,
|
||||
file_name=ldda.file_name,
|
||||
uploaded_by=ldda.user.email,
|
||||
message=ldda.message,
|
||||
date_uploaded=ldda.create_time.isoformat(),
|
||||
file_size=int(ldda.get_size()),
|
||||
file_ext=ldda.ext,
|
||||
data_type=ldda.datatype.__class__.__module__ + '.' + ldda.datatype.__class__.__name__,
|
||||
genome_build=ldda.dbkey,
|
||||
misc_info=ldda.info,
|
||||
misc_blurb=ldda.blurb,
|
||||
peek=(lambda ldda: ldda.display_peek() if ldda.peek and ldda.peek != 'no peek' else None)(ldda),
|
||||
template_data=template_data)
|
||||
ldda_id=ldda.id,
|
||||
parent_library_id=self.folder.parent_library.id,
|
||||
folder_id=self.folder_id,
|
||||
model_class=self.__class__.__name__,
|
||||
state=ldda.state,
|
||||
name=ldda.name,
|
||||
file_name=ldda.file_name,
|
||||
uploaded_by=ldda.user.email,
|
||||
message=ldda.message,
|
||||
date_uploaded=ldda.create_time.isoformat(),
|
||||
file_size=int(ldda.get_size()),
|
||||
file_ext=ldda.ext,
|
||||
data_type=ldda.datatype.__class__.__module__ + '.' + ldda.datatype.__class__.__name__,
|
||||
genome_build=ldda.dbkey,
|
||||
misc_info=ldda.info,
|
||||
misc_blurb=ldda.blurb,
|
||||
peek=(lambda ldda: ldda.display_peek() if ldda.peek and ldda.peek != 'no peek' else None)(ldda),
|
||||
template_data=template_data)
|
||||
if ldda.dataset.uuid is None:
|
||||
rval['uuid'] = None
|
||||
else:
|
||||
@@ -2906,12 +2906,12 @@ class LibraryDataset(object):
|
||||
|
||||
class LibraryDatasetDatasetAssociation(DatasetInstance, HasName):
|
||||
def __init__(self,
|
||||
copied_from_history_dataset_association=None,
|
||||
copied_from_library_dataset_dataset_association=None,
|
||||
library_dataset=None,
|
||||
user=None,
|
||||
sa_session=None,
|
||||
**kwd):
|
||||
copied_from_history_dataset_association=None,
|
||||
copied_from_library_dataset_dataset_association=None,
|
||||
library_dataset=None,
|
||||
user=None,
|
||||
sa_session=None,
|
||||
**kwd):
|
||||
# FIXME: sa_session is must be passed to DataSetInstance if the create_dataset
|
||||
# parameter in kwd is True so that the new object can be flushed. Is there a better way?
|
||||
DatasetInstance.__init__(self, sa_session=sa_session, **kwd)
|
||||
@@ -2925,18 +2925,18 @@ class LibraryDatasetDatasetAssociation(DatasetInstance, HasName):
|
||||
def to_history_dataset_association(self, target_history, parent_id=None, add_to_history=False):
|
||||
sa_session = object_session(self)
|
||||
hda = HistoryDatasetAssociation(name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_library_dataset_dataset_association=self,
|
||||
history=target_history)
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_library_dataset_dataset_association=self,
|
||||
history=target_history)
|
||||
|
||||
tag_manager = tags.GalaxyTagManager(sa_session)
|
||||
src_ldda_tags = tag_manager.get_tags_str(self.tags)
|
||||
@@ -2957,18 +2957,18 @@ class LibraryDatasetDatasetAssociation(DatasetInstance, HasName):
|
||||
def copy(self, copy_children=False, parent_id=None, target_folder=None):
|
||||
sa_session = object_session(self)
|
||||
ldda = LibraryDatasetDatasetAssociation(name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_library_dataset_dataset_association=self,
|
||||
folder=target_folder)
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
tool_version=self.tool_version,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_library_dataset_dataset_association=self,
|
||||
folder=target_folder)
|
||||
|
||||
tag_manager = tags.GalaxyTagManager(sa_session)
|
||||
src_ldda_tags = tag_manager.get_tags_str(self.tags)
|
||||
@@ -3024,21 +3024,21 @@ class LibraryDatasetDatasetAssociation(DatasetInstance, HasName):
|
||||
|
||||
# TODO: render tags here
|
||||
rval = dict(id=ldda.id,
|
||||
hda_ldda='ldda',
|
||||
model_class=self.__class__.__name__,
|
||||
name=ldda.name,
|
||||
deleted=ldda.deleted,
|
||||
visible=ldda.visible,
|
||||
state=ldda.state,
|
||||
library_dataset_id=ldda.library_dataset_id,
|
||||
file_size=file_size,
|
||||
file_name=ldda.file_name,
|
||||
update_time=ldda.update_time.isoformat(),
|
||||
file_ext=ldda.ext,
|
||||
data_type=ldda.datatype.__class__.__module__ + '.' + ldda.datatype.__class__.__name__,
|
||||
genome_build=ldda.dbkey,
|
||||
misc_info=ldda.info,
|
||||
misc_blurb=ldda.blurb)
|
||||
hda_ldda='ldda',
|
||||
model_class=self.__class__.__name__,
|
||||
name=ldda.name,
|
||||
deleted=ldda.deleted,
|
||||
visible=ldda.visible,
|
||||
state=ldda.state,
|
||||
library_dataset_id=ldda.library_dataset_id,
|
||||
file_size=file_size,
|
||||
file_name=ldda.file_name,
|
||||
update_time=ldda.update_time.isoformat(),
|
||||
file_ext=ldda.ext,
|
||||
data_type=ldda.datatype.__class__.__module__ + '.' + ldda.datatype.__class__.__name__,
|
||||
genome_build=ldda.dbkey,
|
||||
misc_info=ldda.info,
|
||||
misc_blurb=ldda.blurb)
|
||||
if ldda.dataset.uuid is None:
|
||||
rval['uuid'] = None
|
||||
else:
|
||||
@@ -3367,9 +3367,9 @@ class DatasetCollectionInstance(object, HasName):
|
||||
|
||||
|
||||
class HistoryDatasetCollectionAssociation(DatasetCollectionInstance,
|
||||
HasTags,
|
||||
Dictifiable,
|
||||
UsesAnnotations):
|
||||
HasTags,
|
||||
Dictifiable,
|
||||
UsesAnnotations):
|
||||
""" Associates a DatasetCollection with a History. """
|
||||
editable_keys = ('name', 'deleted', 'visible')
|
||||
|
||||
@@ -3413,7 +3413,7 @@ class HistoryDatasetCollectionAssociation(DatasetCollectionInstance,
|
||||
@type_id.expression
|
||||
def type_id(cls):
|
||||
return ((type_coerce(cls.content_type, types.Unicode) + u'-' +
|
||||
type_coerce(cls.id, types.Unicode)).label('type_id'))
|
||||
type_coerce(cls.id, types.Unicode)).label('type_id'))
|
||||
|
||||
def to_hda_representative(self, multiple=False):
|
||||
rval = []
|
||||
@@ -3620,16 +3620,16 @@ class Event(object):
|
||||
|
||||
class GalaxySession(object):
|
||||
def __init__(self,
|
||||
id=None,
|
||||
user=None,
|
||||
remote_host=None,
|
||||
remote_addr=None,
|
||||
referer=None,
|
||||
current_history=None,
|
||||
session_key=None,
|
||||
is_valid=False,
|
||||
prev_session_id=None,
|
||||
last_action=None):
|
||||
id=None,
|
||||
user=None,
|
||||
remote_host=None,
|
||||
remote_addr=None,
|
||||
referer=None,
|
||||
current_history=None,
|
||||
session_key=None,
|
||||
is_valid=False,
|
||||
prev_session_id=None,
|
||||
last_action=None):
|
||||
self.id = id
|
||||
self.user = user
|
||||
self.remote_host = remote_host
|
||||
@@ -3911,9 +3911,9 @@ class WorkflowStep(object):
|
||||
new_conn.input_subworkflow_step = subworkflow_step_mapping[old_conn.input_subworkflow_step_id]
|
||||
for orig_pja in self.post_job_actions:
|
||||
PostJobAction(orig_pja.action_type,
|
||||
copied_step,
|
||||
output_name=orig_pja.output_name,
|
||||
action_arguments=orig_pja.action_arguments)
|
||||
copied_step,
|
||||
output_name=orig_pja.output_name,
|
||||
action_arguments=orig_pja.action_arguments)
|
||||
copied_step.workflow_outputs = copy_list(self.workflow_outputs, copied_step)
|
||||
|
||||
def log_str(self):
|
||||
@@ -4290,11 +4290,11 @@ class FormDefinition(object, Dictifiable):
|
||||
# The following form_builder classes are supported by the FormDefinition class.
|
||||
supported_field_types = [AddressField, CheckboxField, PasswordField, SelectField, TextArea, TextField, WorkflowField, WorkflowMappingField, HistoryField]
|
||||
types = Bunch(REQUEST='Sequencing Request Form',
|
||||
SAMPLE='Sequencing Sample Form',
|
||||
EXTERNAL_SERVICE='External Service Information Form',
|
||||
RUN_DETAILS_TEMPLATE='Sample run details template',
|
||||
LIBRARY_INFO_TEMPLATE='Library information template',
|
||||
USER_INFO='User Information')
|
||||
SAMPLE='Sequencing Sample Form',
|
||||
EXTERNAL_SERVICE='External Service Information Form',
|
||||
RUN_DETAILS_TEMPLATE='Sample run details template',
|
||||
LIBRARY_INFO_TEMPLATE='Library information template',
|
||||
USER_INFO='User Information')
|
||||
dict_collection_visible_keys = ('id', 'name')
|
||||
dict_element_visible_keys = ('id', 'name', 'desc', 'form_definition_current_id', 'fields', 'layout')
|
||||
|
||||
@@ -4311,13 +4311,13 @@ class FormDefinition(object, Dictifiable):
|
||||
form_def = {'id': security.encode_id(self.id) if security else self.id, 'name': self.name, 'inputs': []}
|
||||
for field in self.fields:
|
||||
FieldClass = ({'AddressField' : AddressField,
|
||||
'CheckboxField' : CheckboxField,
|
||||
'HistoryField' : HistoryField,
|
||||
'PasswordField' : PasswordField,
|
||||
'SelectField' : SelectField,
|
||||
'TextArea' : TextArea,
|
||||
'TextField' : TextField,
|
||||
'WorkflowField' : WorkflowField}).get(field['type'], TextField)
|
||||
'CheckboxField' : CheckboxField,
|
||||
'HistoryField' : HistoryField,
|
||||
'PasswordField' : PasswordField,
|
||||
'SelectField' : SelectField,
|
||||
'TextArea' : TextArea,
|
||||
'TextField' : TextField,
|
||||
'WorkflowField' : WorkflowField}).get(field['type'], TextField)
|
||||
form_def['inputs'].append(FieldClass(user=user, value=values.get(field['name'], field['default']), security=security, **field).to_dict())
|
||||
return form_def
|
||||
|
||||
@@ -4436,9 +4436,9 @@ class FormValues(object):
|
||||
|
||||
class Request(object, Dictifiable):
|
||||
states = Bunch(NEW='New',
|
||||
SUBMITTED='In Progress',
|
||||
REJECTED='Rejected',
|
||||
COMPLETE='Complete')
|
||||
SUBMITTED='In Progress',
|
||||
REJECTED='Rejected',
|
||||
COMPLETE='Complete')
|
||||
dict_collection_visible_keys = ('id', 'name', 'state')
|
||||
|
||||
def __init__(self, name=None, desc=None, request_type=None, user=None, form_values=None, notification=None):
|
||||
@@ -4556,13 +4556,13 @@ All samples in state: %(sample_state)s
|
||||
|
||||
"""
|
||||
values = dict(user=self.user.email,
|
||||
request_name=self.name,
|
||||
request_type=self.type.name,
|
||||
request_state=self.state,
|
||||
num_samples=str(len(self.samples)),
|
||||
sample_state=common_state.name,
|
||||
create_time=self.create_time,
|
||||
submit_time=self.create_time)
|
||||
request_name=self.name,
|
||||
request_type=self.type.name,
|
||||
request_state=self.state,
|
||||
num_samples=str(len(self.samples)),
|
||||
sample_state=common_state.name,
|
||||
create_time=self.create_time,
|
||||
submit_time=self.create_time)
|
||||
body = body % values
|
||||
# check if this is the final state of the samples
|
||||
if final_state:
|
||||
@@ -4608,8 +4608,8 @@ class RequestEvent(object):
|
||||
|
||||
class ExternalService(object):
|
||||
data_transfer_protocol = Bunch(HTTP='http',
|
||||
HTTPS='https',
|
||||
SCP='scp')
|
||||
HTTPS='https',
|
||||
SCP='scp')
|
||||
|
||||
def __init__(self, name=None, description=None, external_service_type_id=None, version=None, form_definition_id=None, form_values_id=None, deleted=None):
|
||||
self.name = name
|
||||
@@ -4653,9 +4653,9 @@ class RequestType(object, Dictifiable):
|
||||
dict_collection_visible_keys = ('id', 'name', 'desc')
|
||||
dict_element_visible_keys = ('id', 'name', 'desc', 'request_form_id', 'sample_form_id')
|
||||
rename_dataset_options = Bunch(NO='Do not rename',
|
||||
SAMPLE_NAME='Preprend sample name',
|
||||
EXPERIMENT_NAME='Prepend experiment name',
|
||||
EXPERIMENT_AND_SAMPLE_NAME='Prepend experiment and sample name')
|
||||
SAMPLE_NAME='Preprend sample name',
|
||||
EXPERIMENT_NAME='Prepend experiment name',
|
||||
EXPERIMENT_AND_SAMPLE_NAME='Prepend experiment and sample name')
|
||||
permitted_actions = get_permitted_actions(filter='REQUEST_TYPE')
|
||||
|
||||
def __init__(self, name=None, desc=None, request_form=None, sample_form=None):
|
||||
@@ -4751,7 +4751,7 @@ class Sample(object, Dictifiable):
|
||||
# The following form_builder classes are supported by the Sample class.
|
||||
supported_field_types = [CheckboxField, SelectField, TextField, WorkflowField, WorkflowMappingField, HistoryField]
|
||||
bulk_operations = Bunch(CHANGE_STATE='Change state',
|
||||
SELECT_LIBRARY='Select data library and folder')
|
||||
SELECT_LIBRARY='Select data library and folder')
|
||||
dict_collection_visible_keys = ('id', 'name')
|
||||
|
||||
def __init__(self, name=None, desc=None, request=None, form_values=None, bar_code=None, library=None, folder=None, workflow=None, history=None):
|
||||
@@ -4890,11 +4890,11 @@ class SampleEvent(object):
|
||||
|
||||
class SampleDataset(object):
|
||||
transfer_status = Bunch(NOT_STARTED='Not started',
|
||||
IN_QUEUE='In queue',
|
||||
TRANSFERRING='Transferring dataset',
|
||||
ADD_TO_LIBRARY='Adding to data library',
|
||||
COMPLETE='Complete',
|
||||
ERROR='Error')
|
||||
IN_QUEUE='In queue',
|
||||
TRANSFERRING='Transferring dataset',
|
||||
ADD_TO_LIBRARY='Adding to data library',
|
||||
COMPLETE='Complete',
|
||||
ERROR='Error')
|
||||
|
||||
def __init__(self, sample=None, name=None, file_path=None, status=None, error_msg=None, size=None, external_service=None):
|
||||
self.sample = sample
|
||||
@@ -4927,8 +4927,8 @@ class SampleRunAssociation(object):
|
||||
|
||||
class UserAddress(object):
|
||||
def __init__(self, user=None, desc=None, name=None, institution=None,
|
||||
address=None, city=None, state=None, postal_code=None,
|
||||
country=None, phone=None):
|
||||
address=None, city=None, state=None, postal_code=None,
|
||||
country=None, phone=None):
|
||||
self.user = user
|
||||
self.desc = desc
|
||||
self.name = name
|
||||
@@ -4942,15 +4942,15 @@ class UserAddress(object):
|
||||
|
||||
def to_dict(self, trans):
|
||||
return {'id' : trans.security.encode_id(self.id),
|
||||
'name' : sanitize_html(self.name),
|
||||
'desc' : sanitize_html(self.desc),
|
||||
'institution' : sanitize_html(self.institution),
|
||||
'address' : sanitize_html(self.address),
|
||||
'city' : sanitize_html(self.city),
|
||||
'state' : sanitize_html(self.state),
|
||||
'postal_code' : sanitize_html(self.postal_code),
|
||||
'country' : sanitize_html(self.country),
|
||||
'phone' : sanitize_html(self.phone)}
|
||||
'name' : sanitize_html(self.name),
|
||||
'desc' : sanitize_html(self.desc),
|
||||
'institution' : sanitize_html(self.institution),
|
||||
'address' : sanitize_html(self.address),
|
||||
'city' : sanitize_html(self.city),
|
||||
'state' : sanitize_html(self.state),
|
||||
'postal_code' : sanitize_html(self.postal_code),
|
||||
'country' : sanitize_html(self.country),
|
||||
'phone' : sanitize_html(self.phone)}
|
||||
|
||||
def get_html(self):
|
||||
# This should probably be deprecated eventually. It should currently
|
||||
@@ -5095,13 +5095,13 @@ class TransferJob(object):
|
||||
# These states are used both by the transfer manager's IPC and the object
|
||||
# state in the database. Not all states are used by both.
|
||||
states = Bunch(NEW='new',
|
||||
UNKNOWN='unknown',
|
||||
PROGRESS='progress',
|
||||
RUNNING='running',
|
||||
ERROR='error',
|
||||
DONE='done')
|
||||
UNKNOWN='unknown',
|
||||
PROGRESS='progress',
|
||||
RUNNING='running',
|
||||
ERROR='error',
|
||||
DONE='done')
|
||||
terminal_states = [states.ERROR,
|
||||
states.DONE]
|
||||
states.DONE]
|
||||
|
||||
def __init__(self, state=None, path=None, info=None, pid=None, socket=None, params=None):
|
||||
self.state = state
|
||||
|
||||
@@ -240,11 +240,11 @@ def total_size(o, handlers={}, verbose=False):
|
||||
return chain.from_iterable(d.items())
|
||||
|
||||
all_handlers = {tuple: iter,
|
||||
list: iter,
|
||||
deque: iter,
|
||||
dict: dict_handler,
|
||||
set: iter,
|
||||
frozenset: iter}
|
||||
list: iter,
|
||||
deque: iter,
|
||||
dict: dict_handler,
|
||||
set: iter,
|
||||
frozenset: iter}
|
||||
all_handlers.update(handlers) # user handlers take precedence
|
||||
seen = set() # track which object id's have already been seen
|
||||
default_size = getsizeof(0) # estimate sizeof object without __sizeof__
|
||||
|
||||
+35
-35
@@ -127,9 +127,9 @@ model.HistoryDatasetAssociation.table = Table(
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("state", TrimmedString(64), index=True, key="_state"),
|
||||
Column("copied_from_history_dataset_association_id", Integer,
|
||||
ForeignKey("history_dataset_association.id"), nullable=True),
|
||||
ForeignKey("history_dataset_association.id"), nullable=True),
|
||||
Column("copied_from_library_dataset_dataset_association_id", Integer,
|
||||
ForeignKey("library_dataset_dataset_association.id"), nullable=True),
|
||||
ForeignKey("library_dataset_dataset_association.id"), nullable=True),
|
||||
Column("name", TrimmedString(255)),
|
||||
Column("info", TrimmedString(255)),
|
||||
Column("blurb", TrimmedString(255)),
|
||||
@@ -145,7 +145,7 @@ model.HistoryDatasetAssociation.table = Table(
|
||||
Column("hid", Integer),
|
||||
Column("purged", Boolean, index=True, default=False),
|
||||
Column("hidden_beneath_collection_instance_id",
|
||||
ForeignKey("history_dataset_collection_association.id"), nullable=True))
|
||||
ForeignKey("history_dataset_collection_association.id"), nullable=True))
|
||||
|
||||
model.Dataset.table = Table(
|
||||
"dataset", metadata,
|
||||
@@ -1585,32 +1585,32 @@ simple_mapping(model.HistoryDatasetAssociation,
|
||||
# .history defined in History mapper
|
||||
copied_from_history_dataset_association=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.HistoryDatasetAssociation.table.c.copied_from_history_dataset_association_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id),
|
||||
model.HistoryDatasetAssociation.table.c.id),
|
||||
remote_side=[model.HistoryDatasetAssociation.table.c.id],
|
||||
uselist=False),
|
||||
copied_to_history_dataset_associations=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.HistoryDatasetAssociation.table.c.copied_from_history_dataset_association_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
copied_from_library_dataset_dataset_association=relation(
|
||||
model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(model.HistoryDatasetAssociation.table.c.copied_from_library_dataset_dataset_association_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id),
|
||||
uselist=False),
|
||||
copied_to_library_dataset_dataset_associations=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(model.HistoryDatasetAssociation.table.c.copied_from_library_dataset_dataset_association_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
implicitly_converted_datasets=relation(model.ImplicitlyConvertedDatasetAssociation,
|
||||
primaryjoin=(model.ImplicitlyConvertedDatasetAssociation.table.c.hda_parent_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
implicitly_converted_parent_datasets=relation(model.ImplicitlyConvertedDatasetAssociation,
|
||||
primaryjoin=(model.ImplicitlyConvertedDatasetAssociation.table.c.hda_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
children=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.HistoryDatasetAssociation.table.c.parent_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id),
|
||||
backref=backref("parent",
|
||||
primaryjoin=(model.HistoryDatasetAssociation.table.c.parent_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id),
|
||||
model.HistoryDatasetAssociation.table.c.id),
|
||||
remote_side=[model.HistoryDatasetAssociation.table.c.id], uselist=False)),
|
||||
visible_children=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(
|
||||
@@ -1628,10 +1628,10 @@ simple_mapping(model.HistoryDatasetAssociation,
|
||||
backref="hdas"),
|
||||
extended_metadata=relation(model.ExtendedMetadata,
|
||||
primaryjoin=((model.HistoryDatasetAssociation.table.c.extended_metadata_id ==
|
||||
model.ExtendedMetadata.table.c.id))),
|
||||
model.ExtendedMetadata.table.c.id))),
|
||||
hidden_beneath_collection_instance=relation(model.HistoryDatasetCollectionAssociation,
|
||||
primaryjoin=((model.HistoryDatasetAssociation.table.c.hidden_beneath_collection_instance_id ==
|
||||
model.HistoryDatasetCollectionAssociation.table.c.id)),
|
||||
model.HistoryDatasetCollectionAssociation.table.c.id)),
|
||||
uselist=False,
|
||||
backref="hidden_dataset_instances"),
|
||||
_metadata=deferred(model.HistoryDatasetAssociation.table.c._metadata)
|
||||
@@ -1668,25 +1668,25 @@ mapper(model.HistoryDatasetAssociationDisplayAtAuthorization, model.HistoryDatas
|
||||
mapper(model.HistoryDatasetAssociationSubset, model.HistoryDatasetAssociationSubset.table, properties=dict(
|
||||
hda=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.HistoryDatasetAssociationSubset.table.c.history_dataset_association_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
subset=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.HistoryDatasetAssociationSubset.table.c.history_dataset_association_subset_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id))
|
||||
model.HistoryDatasetAssociation.table.c.id))
|
||||
))
|
||||
|
||||
mapper(model.ImplicitlyConvertedDatasetAssociation, model.ImplicitlyConvertedDatasetAssociation.table, properties=dict(
|
||||
parent_hda=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.ImplicitlyConvertedDatasetAssociation.table.c.hda_parent_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
model.HistoryDatasetAssociation.table.c.id)),
|
||||
parent_ldda=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(model.ImplicitlyConvertedDatasetAssociation.table.c.ldda_parent_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
dataset_ldda=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(model.ImplicitlyConvertedDatasetAssociation.table.c.ldda_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
dataset=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.ImplicitlyConvertedDatasetAssociation.table.c.hda_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id))
|
||||
model.HistoryDatasetAssociation.table.c.id))
|
||||
))
|
||||
|
||||
mapper(model.History, model.History.table, properties=dict(
|
||||
@@ -1778,7 +1778,7 @@ mapper(model.User, model.User.table, properties=dict(
|
||||
))
|
||||
|
||||
mapper(model.PasswordResetToken, model.PasswordResetToken.table,
|
||||
properties=dict(user=relation(model.User, backref="reset_tokens")))
|
||||
properties=dict(user=relation(model.User, backref="reset_tokens")))
|
||||
|
||||
|
||||
# Set up proxy so that this syntax is possible:
|
||||
@@ -1951,13 +1951,13 @@ mapper(model.LibraryDataset, model.LibraryDataset.table, properties=dict(
|
||||
folder=relation(model.LibraryFolder),
|
||||
library_dataset_dataset_association=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(model.LibraryDataset.table.c.library_dataset_dataset_association_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
expired_datasets=relation(model.LibraryDatasetDatasetAssociation,
|
||||
foreign_keys=[model.LibraryDataset.table.c.id, model.LibraryDataset.table.c.library_dataset_dataset_association_id],
|
||||
primaryjoin=(
|
||||
(model.LibraryDataset.table.c.id == model.LibraryDatasetDatasetAssociation.table.c.library_dataset_id) &
|
||||
(not_(model.LibraryDataset.table.c.library_dataset_dataset_association_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id))
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id))
|
||||
),
|
||||
viewonly=True,
|
||||
uselist=True)
|
||||
@@ -1971,28 +1971,28 @@ mapper(model.LibraryDatasetDatasetAssociation, model.LibraryDatasetDatasetAssoci
|
||||
user=relation(model.User),
|
||||
copied_from_library_dataset_dataset_association=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(model.LibraryDatasetDatasetAssociation.table.c.copied_from_library_dataset_dataset_association_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id),
|
||||
remote_side=[model.LibraryDatasetDatasetAssociation.table.c.id],
|
||||
uselist=False),
|
||||
copied_to_library_dataset_dataset_associations=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(model.LibraryDatasetDatasetAssociation.table.c.copied_from_library_dataset_dataset_association_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
copied_from_history_dataset_association=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.LibraryDatasetDatasetAssociation.table.c.copied_from_history_dataset_association_id ==
|
||||
model.HistoryDatasetAssociation.table.c.id),
|
||||
model.HistoryDatasetAssociation.table.c.id),
|
||||
uselist=False),
|
||||
copied_to_history_dataset_associations=relation(model.HistoryDatasetAssociation,
|
||||
primaryjoin=(model.HistoryDatasetAssociation.table.c.copied_from_library_dataset_dataset_association_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
implicitly_converted_datasets=relation(model.ImplicitlyConvertedDatasetAssociation,
|
||||
primaryjoin=(model.ImplicitlyConvertedDatasetAssociation.table.c.ldda_parent_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id)),
|
||||
children=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(model.LibraryDatasetDatasetAssociation.table.c.parent_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id),
|
||||
backref=backref("parent",
|
||||
primaryjoin=(model.LibraryDatasetDatasetAssociation.table.c.parent_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id),
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id),
|
||||
remote_side=[model.LibraryDatasetDatasetAssociation.table.c.id])),
|
||||
visible_children=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(
|
||||
@@ -2013,7 +2013,7 @@ mapper(model.LibraryDatasetDatasetInfoAssociation, model.LibraryDatasetDatasetIn
|
||||
library_dataset_dataset_association=relation(model.LibraryDatasetDatasetAssociation,
|
||||
primaryjoin=(
|
||||
(model.LibraryDatasetDatasetInfoAssociation.table.c.library_dataset_dataset_association_id ==
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id) &
|
||||
model.LibraryDatasetDatasetAssociation.table.c.id) &
|
||||
(not_(model.LibraryDatasetDatasetInfoAssociation.table.c.deleted))
|
||||
),
|
||||
backref="info_association"),
|
||||
@@ -2086,7 +2086,7 @@ simple_mapping(model.TaskMetricNumeric,
|
||||
simple_mapping(model.ImplicitlyCreatedDatasetCollectionInput,
|
||||
input_dataset_collection=relation(model.HistoryDatasetCollectionAssociation,
|
||||
primaryjoin=((model.HistoryDatasetCollectionAssociation.table.c.id ==
|
||||
model.ImplicitlyCreatedDatasetCollectionInput.table.c.input_dataset_collection_id)),
|
||||
model.ImplicitlyCreatedDatasetCollectionInput.table.c.input_dataset_collection_id)),
|
||||
# backref="implicitly_created_dataset_collections",
|
||||
),
|
||||
)
|
||||
@@ -2170,15 +2170,15 @@ simple_mapping(model.HistoryDatasetCollectionAssociation,
|
||||
backref='dataset_collections'),
|
||||
copied_from_history_dataset_collection_association=relation(model.HistoryDatasetCollectionAssociation,
|
||||
primaryjoin=(model.HistoryDatasetCollectionAssociation.table.c.copied_from_history_dataset_collection_association_id ==
|
||||
model.HistoryDatasetCollectionAssociation.table.c.id),
|
||||
model.HistoryDatasetCollectionAssociation.table.c.id),
|
||||
remote_side=[model.HistoryDatasetCollectionAssociation.table.c.id],
|
||||
uselist=False),
|
||||
copied_to_history_dataset_collection_associations=relation(model.HistoryDatasetCollectionAssociation,
|
||||
primaryjoin=(model.HistoryDatasetCollectionAssociation.table.c.copied_from_history_dataset_collection_association_id ==
|
||||
model.HistoryDatasetCollectionAssociation.table.c.id)),
|
||||
model.HistoryDatasetCollectionAssociation.table.c.id)),
|
||||
implicit_input_collections=relation(model.ImplicitlyCreatedDatasetCollectionInput,
|
||||
primaryjoin=((model.HistoryDatasetCollectionAssociation.table.c.id ==
|
||||
model.ImplicitlyCreatedDatasetCollectionInput.table.c.dataset_collection_id)),
|
||||
model.ImplicitlyCreatedDatasetCollectionInput.table.c.dataset_collection_id)),
|
||||
backref="dataset_collection",
|
||||
),
|
||||
tags=relation(model.HistoryDatasetCollectionTagAssociation,
|
||||
@@ -2294,7 +2294,7 @@ mapper(model.StoredWorkflow, model.StoredWorkflow.table, properties=dict(
|
||||
owner_tags=relation(model.StoredWorkflowTagAssociation,
|
||||
primaryjoin=(
|
||||
and_(model.StoredWorkflow.table.c.id == model.StoredWorkflowTagAssociation.table.c.stored_workflow_id,
|
||||
model.StoredWorkflow.table.c.user_id == model.StoredWorkflowTagAssociation.table.c.user_id)
|
||||
model.StoredWorkflow.table.c.user_id == model.StoredWorkflowTagAssociation.table.c.user_id)
|
||||
),
|
||||
order_by=model.StoredWorkflowTagAssociation.table.c.id),
|
||||
annotations=relation(model.StoredWorkflowAnnotationAssociation,
|
||||
@@ -2411,8 +2411,8 @@ mapper(model.Page, model.Page.table, properties=dict(
|
||||
model.Page.users_shared_with_dot_users = association_proxy('users_shared_with', 'user')
|
||||
|
||||
mapper(model.PageUserShareAssociation, model.PageUserShareAssociation.table,
|
||||
properties=dict(user=relation(model.User, backref='pages_shared_by_others'),
|
||||
page=relation(model.Page, backref='users_shared_with')))
|
||||
properties=dict(user=relation(model.User, backref='pages_shared_by_others'),
|
||||
page=relation(model.Page, backref='users_shared_with')))
|
||||
|
||||
mapper(model.VisualizationRevision, model.VisualizationRevision.table)
|
||||
|
||||
|
||||
@@ -310,8 +310,8 @@ class MetadataElementSpec(object):
|
||||
is a MetadataSpecCollection) of datatype.
|
||||
"""
|
||||
def __init__(self, datatype, name=None, desc=None,
|
||||
param=MetadataParameter, default=None, no_value=None,
|
||||
visible=True, set_in_upload=False, **kwargs):
|
||||
param=MetadataParameter, default=None, no_value=None,
|
||||
visible=True, set_in_upload=False, **kwargs):
|
||||
self.name = name
|
||||
self.desc = desc or name
|
||||
self.default = default
|
||||
@@ -605,10 +605,10 @@ class FileParameter(MetadataParameter):
|
||||
# directory. Correct.
|
||||
file_name = path_rewriter(file_name)
|
||||
parent.dataset.object_store.update_from_file(mf,
|
||||
file_name=file_name,
|
||||
extra_dir='_metadata_files',
|
||||
extra_dir_at_root=True,
|
||||
alt_name=os.path.basename(mf.file_name))
|
||||
file_name=file_name,
|
||||
extra_dir='_metadata_files',
|
||||
extra_dir_at_root=True,
|
||||
alt_name=os.path.basename(mf.file_name))
|
||||
os.unlink(file_name)
|
||||
value = mf.id
|
||||
return value
|
||||
@@ -654,8 +654,8 @@ class MetadataTempFile(object):
|
||||
|
||||
def to_JSON(self):
|
||||
return {'__class__': self.__class__.__name__,
|
||||
'filename': self.file_name,
|
||||
'kwds': self.kwds}
|
||||
'filename': self.file_name,
|
||||
'kwds': self.kwds}
|
||||
|
||||
@classmethod
|
||||
def from_JSON(cls, json_dict):
|
||||
@@ -699,14 +699,14 @@ class JobExternalOutputMetadataWrapper(object):
|
||||
if isinstance(dataset, galaxy.model.HistoryDatasetAssociation):
|
||||
return sa_session.query(galaxy.model.JobExternalOutputMetadata) \
|
||||
.filter_by(job_id=self.job_id,
|
||||
history_dataset_association_id=dataset.id,
|
||||
is_valid=True) \
|
||||
history_dataset_association_id=dataset.id,
|
||||
is_valid=True) \
|
||||
.first() # there should only be one or None
|
||||
elif isinstance(dataset, galaxy.model.LibraryDatasetDatasetAssociation):
|
||||
return sa_session.query(galaxy.model.JobExternalOutputMetadata) \
|
||||
.filter_by(job_id=self.job_id,
|
||||
library_dataset_dataset_association_id=dataset.id,
|
||||
is_valid=True) \
|
||||
library_dataset_dataset_association_id=dataset.id,
|
||||
is_valid=True) \
|
||||
.first() # there should only be one or None
|
||||
return None
|
||||
|
||||
@@ -726,12 +726,12 @@ class JobExternalOutputMetadataWrapper(object):
|
||||
jeom = self.get_output_filenames_by_dataset(dataset, sa_session)
|
||||
|
||||
def setup_external_metadata(self, datasets, sa_session, exec_dir=None,
|
||||
tmp_dir=None, dataset_files_path=None,
|
||||
output_fnames=None, config_root=None,
|
||||
config_file=None, datatypes_config=None,
|
||||
job_metadata=None, compute_tmp_dir=None,
|
||||
include_command=True, max_metadata_value_size=0,
|
||||
kwds=None):
|
||||
tmp_dir=None, dataset_files_path=None,
|
||||
output_fnames=None, config_root=None,
|
||||
config_file=None, datatypes_config=None,
|
||||
job_metadata=None, compute_tmp_dir=None,
|
||||
include_command=True, max_metadata_value_size=0,
|
||||
kwds=None):
|
||||
kwds = kwds or {}
|
||||
if tmp_dir is None:
|
||||
tmp_dir = MetadataTempFile.tmp_dir
|
||||
@@ -834,9 +834,9 @@ class JobExternalOutputMetadataWrapper(object):
|
||||
sa_session.flush()
|
||||
metadata_files_list.append(metadata_files)
|
||||
args = '"%s" "%s" %s %s' % (datatypes_config,
|
||||
job_metadata,
|
||||
" ".join(map(__metadata_files_list_to_cmd_line, metadata_files_list)),
|
||||
max_metadata_value_size)
|
||||
job_metadata,
|
||||
" ".join(map(__metadata_files_list_to_cmd_line, metadata_files_list)),
|
||||
max_metadata_value_size)
|
||||
if include_command:
|
||||
# return command required to build
|
||||
fd, fp = tempfile.mkstemp(suffix='.py', dir=tmp_dir, prefix="set_metadata_")
|
||||
@@ -864,10 +864,10 @@ class JobExternalOutputMetadataWrapper(object):
|
||||
MetadataTempFile.cleanup_from_JSON_dict_filename(metadata_files.filename_out)
|
||||
dataset_key = self.get_dataset_metadata_key(metadata_files.dataset)
|
||||
for key, fname in [('filename_in', metadata_files.filename_in),
|
||||
('filename_out', metadata_files.filename_out),
|
||||
('filename_results_code', metadata_files.filename_results_code),
|
||||
('filename_kwds', metadata_files.filename_kwds),
|
||||
('filename_override_metadata', metadata_files.filename_override_metadata)]:
|
||||
('filename_out', metadata_files.filename_out),
|
||||
('filename_results_code', metadata_files.filename_results_code),
|
||||
('filename_kwds', metadata_files.filename_kwds),
|
||||
('filename_override_metadata', metadata_files.filename_override_metadata)]:
|
||||
try:
|
||||
os.remove(fname)
|
||||
except Exception as e:
|
||||
|
||||
@@ -94,7 +94,7 @@ def create_or_verify_database(url, galaxy_config_file, engine_options={}, app=No
|
||||
if galaxy_config_file and os.path.abspath(os.path.join(os.getcwd(), 'config', 'galaxy.ini')) != galaxy_config_file:
|
||||
config_arg = ' -c %s' % galaxy_config_file.replace(os.path.abspath(os.getcwd()), '.')
|
||||
raise Exception("Your database has version '%d' but this code expects version '%d'. Please backup your database and then migrate the schema by running 'sh manage_db.sh%s upgrade'."
|
||||
% (db_schema.version, migrate_repository.versions.latest, config_arg))
|
||||
% (db_schema.version, migrate_repository.versions.latest, config_arg))
|
||||
else:
|
||||
log.info("At database version %d" % db_schema.version)
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ StoredWorkflow_table = Table("stored_workflow", metadata,
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("latest_workflow_id", Integer,
|
||||
ForeignKey("workflow.id", use_alter=True, name='stored_workflow_latest_workflow_id_fk'), index=True),
|
||||
ForeignKey("workflow.id", use_alter=True, name='stored_workflow_latest_workflow_id_fk'), index=True),
|
||||
Column("name", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
|
||||
@@ -423,8 +423,8 @@ def upgrade(migrate_engine):
|
||||
if HistoryDatasetAssociation_table is not None and LibraryDatasetDatasetAssociation_table is not None:
|
||||
try:
|
||||
cons = ForeignKeyConstraint([HistoryDatasetAssociation_table.c.copied_from_library_dataset_dataset_association_id],
|
||||
[LibraryDatasetDatasetAssociation_table.c.id],
|
||||
name='history_dataset_association_copied_from_library_dataset_da_fkey')
|
||||
[LibraryDatasetDatasetAssociation_table.c.id],
|
||||
name='history_dataset_association_copied_from_library_dataset_da_fkey')
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception:
|
||||
@@ -445,8 +445,8 @@ def upgrade(migrate_engine):
|
||||
if MetadataFile_table is not None and LibraryDatasetDatasetAssociation_table is not None:
|
||||
try:
|
||||
cons = ForeignKeyConstraint([MetadataFile_table.c.lda_id],
|
||||
[LibraryDatasetDatasetAssociation_table.c.id],
|
||||
name='metadata_file_lda_id_fkey')
|
||||
[LibraryDatasetDatasetAssociation_table.c.id],
|
||||
name='metadata_file_lda_id_fkey')
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception:
|
||||
@@ -553,8 +553,8 @@ def downgrade(migrate_engine):
|
||||
if MetadataFile_table is not None and LibraryDatasetDatasetAssociation_table is not None:
|
||||
try:
|
||||
cons = ForeignKeyConstraint([MetadataFile_table.c.lda_id],
|
||||
[LibraryDatasetDatasetAssociation_table.c.id],
|
||||
name='metadata_file_lda_id_fkey')
|
||||
[LibraryDatasetDatasetAssociation_table.c.id],
|
||||
name='metadata_file_lda_id_fkey')
|
||||
# Drop the constraint
|
||||
cons.drop()
|
||||
except Exception:
|
||||
@@ -573,8 +573,8 @@ def downgrade(migrate_engine):
|
||||
if HistoryDatasetAssociation_table is not None and LibraryDatasetDatasetAssociation_table is not None:
|
||||
try:
|
||||
cons = ForeignKeyConstraint([HistoryDatasetAssociation_table.c.copied_from_library_dataset_dataset_association_id],
|
||||
[LibraryDatasetDatasetAssociation_table.c.id],
|
||||
name='history_dataset_association_copied_from_library_dataset_da_fkey')
|
||||
[LibraryDatasetDatasetAssociation_table.c.id],
|
||||
name='history_dataset_association_copied_from_library_dataset_da_fkey')
|
||||
# Drop the constraint
|
||||
cons.drop()
|
||||
except Exception:
|
||||
|
||||
@@ -39,13 +39,13 @@ def directory_hash_id(id):
|
||||
|
||||
class Dataset(object):
|
||||
states = Bunch(NEW='new',
|
||||
UPLOAD='upload',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
EMPTY='empty',
|
||||
ERROR='error',
|
||||
DISCARDED='discarded')
|
||||
UPLOAD='upload',
|
||||
QUEUED='queued',
|
||||
RUNNING='running',
|
||||
OK='ok',
|
||||
EMPTY='empty',
|
||||
ERROR='error',
|
||||
DISCARDED='discarded')
|
||||
permitted_actions = get_permitted_actions(filter='DATASET')
|
||||
file_path = "/tmp/"
|
||||
engine = None
|
||||
@@ -142,8 +142,8 @@ class DatasetInstance(object):
|
||||
permitted_actions = Dataset.permitted_actions
|
||||
|
||||
def __init__(self, id=None, hid=None, name=None, info=None, blurb=None, peek=None, extension=None,
|
||||
dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None,
|
||||
parent_id=None, validation_errors=None, visible=True, create_dataset=False):
|
||||
dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None,
|
||||
parent_id=None, validation_errors=None, visible=True, create_dataset=False):
|
||||
self.name = name or "Unnamed dataset"
|
||||
self.id = id
|
||||
self.info = info
|
||||
@@ -325,11 +325,11 @@ class DatasetInstance(object):
|
||||
|
||||
class HistoryDatasetAssociation(DatasetInstance):
|
||||
def __init__(self,
|
||||
hid=None,
|
||||
history=None,
|
||||
copied_from_history_dataset_association=None,
|
||||
copied_from_library_dataset_dataset_association=None,
|
||||
**kwd):
|
||||
hid=None,
|
||||
history=None,
|
||||
copied_from_history_dataset_association=None,
|
||||
copied_from_library_dataset_dataset_association=None,
|
||||
**kwd):
|
||||
DatasetInstance.__init__(self, **kwd)
|
||||
self.hid = hid
|
||||
# Relationships
|
||||
@@ -339,18 +339,18 @@ class HistoryDatasetAssociation(DatasetInstance):
|
||||
|
||||
def copy(self, copy_children=False, parent_id=None, target_history=None):
|
||||
hda = HistoryDatasetAssociation(hid=self.hid,
|
||||
name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_history_dataset_association=self,
|
||||
history=target_history)
|
||||
name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_history_dataset_association=self,
|
||||
history=target_history)
|
||||
context.add(hda)
|
||||
context.flush()
|
||||
hda.set_size()
|
||||
@@ -376,18 +376,18 @@ class HistoryDatasetAssociation(DatasetInstance):
|
||||
context.add(library_dataset)
|
||||
context.flush()
|
||||
ldda = LibraryDatasetDatasetAssociation(name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
library_dataset=library_dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_history_dataset_association=self,
|
||||
user=self.history.user)
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
library_dataset=library_dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_history_dataset_association=self,
|
||||
user=self.history.user)
|
||||
context.add(ldda)
|
||||
context.flush()
|
||||
# Permissions must be the same on the LibraryDatasetDatasetAssociation and the associated LibraryDataset
|
||||
@@ -417,11 +417,11 @@ class HistoryDatasetAssociation(DatasetInstance):
|
||||
|
||||
class LibraryDatasetDatasetAssociation(DatasetInstance):
|
||||
def __init__(self,
|
||||
copied_from_history_dataset_association=None,
|
||||
copied_from_library_dataset_dataset_association=None,
|
||||
library_dataset=None,
|
||||
user=None,
|
||||
**kwd):
|
||||
copied_from_history_dataset_association=None,
|
||||
copied_from_library_dataset_dataset_association=None,
|
||||
library_dataset=None,
|
||||
user=None,
|
||||
**kwd):
|
||||
DatasetInstance.__init__(self, **kwd)
|
||||
self.copied_from_history_dataset_association = copied_from_history_dataset_association
|
||||
self.copied_from_library_dataset_dataset_association = copied_from_library_dataset_dataset_association
|
||||
@@ -431,18 +431,18 @@ class LibraryDatasetDatasetAssociation(DatasetInstance):
|
||||
def to_history_dataset_association(self, target_history, parent_id=None):
|
||||
hid = target_history._next_hid()
|
||||
hda = HistoryDatasetAssociation(name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_library_dataset_dataset_association=self,
|
||||
history=target_history,
|
||||
hid=hid)
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_library_dataset_dataset_association=self,
|
||||
history=target_history,
|
||||
hid=hid)
|
||||
context.add(hda)
|
||||
context.flush()
|
||||
hda.metadata = self.metadata # need to set after flushed, as MetadataFiles require dataset.id
|
||||
@@ -455,17 +455,17 @@ class LibraryDatasetDatasetAssociation(DatasetInstance):
|
||||
|
||||
def copy(self, copy_children=False, parent_id=None, target_folder=None):
|
||||
ldda = LibraryDatasetDatasetAssociation(name=self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_library_dataset_dataset_association=self,
|
||||
folder=target_folder)
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
extension=self.extension,
|
||||
dbkey=self.dbkey,
|
||||
dataset=self.dataset,
|
||||
visible=self.visible,
|
||||
deleted=self.deleted,
|
||||
parent_id=parent_id,
|
||||
copied_from_library_dataset_dataset_association=self,
|
||||
folder=target_folder)
|
||||
context.add(ldda)
|
||||
context.flush()
|
||||
# Need to set after flushed, as MetadataFiles require dataset.id
|
||||
|
||||
@@ -22,9 +22,9 @@ log.addHandler(handler)
|
||||
metadata = MetaData()
|
||||
|
||||
HistoryUserShareAssociation_table = Table("history_user_share_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -121,8 +121,8 @@ def upgrade(migrate_engine):
|
||||
if FormDefinitionCurrent_table is not None and FormDefinition_table is not None:
|
||||
try:
|
||||
cons = ForeignKeyConstraint([FormDefinitionCurrent_table.c.latest_form_id],
|
||||
[FormDefinition_table.c.id],
|
||||
name='form_definition_current_latest_form_id_fk')
|
||||
[FormDefinition_table.c.id],
|
||||
name='form_definition_current_latest_form_id_fk')
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception:
|
||||
|
||||
@@ -30,12 +30,12 @@ log.addHandler(handler)
|
||||
metadata = MetaData()
|
||||
|
||||
HistoryDatasetAssociationDisplayAtAuthorization_table = Table("history_dataset_association_display_at_authorization", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, index=True, default=now, onupdate=now),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("site", TrimmedString(255)))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, index=True, default=now, onupdate=now),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("site", TrimmedString(255)))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -26,12 +26,12 @@ log.addHandler(handler)
|
||||
metadata = MetaData()
|
||||
|
||||
HistoryDatasetAssociationDisplayAtAuthorization_table = Table("history_dataset_association_display_at_authorization", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, index=True, default=now, onupdate=now),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("site", TrimmedString(255)))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, index=True, default=now, onupdate=now),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("site", TrimmedString(255)))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -27,21 +27,21 @@ log.addHandler(handler)
|
||||
metadata = MetaData()
|
||||
|
||||
UserAddress_table = Table("user_address", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("desc", TEXT),
|
||||
Column("name", TrimmedString(255), nullable=False),
|
||||
Column("institution", TrimmedString(255)),
|
||||
Column("address", TrimmedString(255), nullable=False),
|
||||
Column("city", TrimmedString(255), nullable=False),
|
||||
Column("state", TrimmedString(255), nullable=False),
|
||||
Column("postal_code", TrimmedString(255), nullable=False),
|
||||
Column("country", TrimmedString(255), nullable=False),
|
||||
Column("phone", TrimmedString(255)),
|
||||
Column("deleted", Boolean, index=True, default=False),
|
||||
Column("purged", Boolean, index=True, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("desc", TEXT),
|
||||
Column("name", TrimmedString(255), nullable=False),
|
||||
Column("institution", TrimmedString(255)),
|
||||
Column("address", TrimmedString(255), nullable=False),
|
||||
Column("city", TrimmedString(255), nullable=False),
|
||||
Column("state", TrimmedString(255), nullable=False),
|
||||
Column("postal_code", TrimmedString(255), nullable=False),
|
||||
Column("country", TrimmedString(255), nullable=False),
|
||||
Column("phone", TrimmedString(255)),
|
||||
Column("deleted", Boolean, index=True, default=False),
|
||||
Column("purged", Boolean, index=True, default=False))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -33,22 +33,22 @@ log.addHandler(handler)
|
||||
metadata = MetaData()
|
||||
|
||||
LibraryInfoAssociation_table = Table('library_info_association', metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("library_id", Integer, ForeignKey("library.id"), index=True),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("library_id", Integer, ForeignKey("library.id"), index=True),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True))
|
||||
|
||||
LibraryFolderInfoAssociation_table = Table('library_folder_info_association', metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("library_folder_id", Integer, ForeignKey("library_folder.id"), nullable=True, index=True),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("library_folder_id", Integer, ForeignKey("library_folder.id"), nullable=True, index=True),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True))
|
||||
|
||||
LibraryDatasetDatasetInfoAssociation_table = Table('library_dataset_dataset_info_association', metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("library_dataset_dataset_association_id", Integer, ForeignKey("library_dataset_dataset_association.id"), nullable=True, index=True),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("library_dataset_dataset_association_id", Integer, ForeignKey("library_dataset_dataset_association.id"), nullable=True, index=True),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -15,22 +15,22 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
Page_table = Table("page", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("latest_revision_id", Integer,
|
||||
ForeignKey("page_revision.id", use_alter=True, name='page_latest_revision_id_fk'), index=True),
|
||||
Column("title", TEXT),
|
||||
Column("slug", TEXT, unique=True, index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("latest_revision_id", Integer,
|
||||
ForeignKey("page_revision.id", use_alter=True, name='page_latest_revision_id_fk'), index=True),
|
||||
Column("title", TEXT),
|
||||
Column("slug", TEXT, unique=True, index=True))
|
||||
|
||||
PageRevision_table = Table("page_revision", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True, nullable=False),
|
||||
Column("title", TEXT),
|
||||
Column("content", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True, nullable=False),
|
||||
Column("title", TEXT),
|
||||
Column("content", TEXT))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -23,32 +23,32 @@ metadata = MetaData()
|
||||
|
||||
# New tables to support tagging of histories, datasets, and history-dataset associations.
|
||||
Tag_table = Table("tag", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("type", Integer),
|
||||
Column("parent_id", Integer, ForeignKey("tag.id")),
|
||||
Column("name", TrimmedString(255)),
|
||||
UniqueConstraint("name"))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("type", Integer),
|
||||
Column("parent_id", Integer, ForeignKey("tag.id")),
|
||||
Column("name", TrimmedString(255)),
|
||||
UniqueConstraint("name"))
|
||||
|
||||
HistoryTagAssociation_table = Table("history_tag_association", metadata,
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
|
||||
DatasetTagAssociation_table = Table("dataset_tag_association", metadata,
|
||||
Column("dataset_id", Integer, ForeignKey("dataset.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
Column("dataset_id", Integer, ForeignKey("dataset.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
|
||||
HistoryDatasetAssociationTagAssociation_table = Table("history_dataset_association_tag_association", metadata,
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -17,11 +17,11 @@ metadata = MetaData()
|
||||
|
||||
|
||||
HistoryDatasetAssociationTagAssociation_table = Table("history_dataset_association_tag_association", metadata,
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -16,36 +16,36 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
HistoryTagAssociation_table = Table("history_tag_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
|
||||
DatasetTagAssociation_table = Table("dataset_tag_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("dataset_id", Integer, ForeignKey("dataset.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("dataset_id", Integer, ForeignKey("dataset.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
|
||||
HistoryDatasetAssociationTagAssociation_table = Table("history_dataset_association_tag_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
|
||||
PageTagAssociation_table = Table("page_tag_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_tname", TrimmedString(255), index=True),
|
||||
Column("value", TrimmedString(255), index=True),
|
||||
Column("user_value", TrimmedString(255), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -52,8 +52,8 @@ def upgrade(migrate_engine):
|
||||
if migrate_engine.name != 'sqlite' and Request_table is not None and LibraryFolder_table is not None:
|
||||
try:
|
||||
cons = ForeignKeyConstraint([Request_table.c.folder_id],
|
||||
[LibraryFolder_table.c.id],
|
||||
name='request_folder_id_fk')
|
||||
[LibraryFolder_table.c.id],
|
||||
name='request_folder_id_fk')
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception:
|
||||
|
||||
@@ -25,10 +25,10 @@ log.addHandler(handler)
|
||||
metadata = MetaData()
|
||||
|
||||
JobToOutputLibraryDatasetAssociation_table = Table("job_to_output_library_dataset", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True),
|
||||
Column("ldda_id", Integer, ForeignKey("library_dataset_dataset_association.id"), index=True),
|
||||
Column("name", String(255)))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True),
|
||||
Column("ldda_id", Integer, ForeignKey("library_dataset_dataset_association.id"), index=True),
|
||||
Column("name", String(255)))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
@@ -65,8 +65,8 @@ def upgrade(migrate_engine):
|
||||
if Job_table is not None and LibraryFolder_table is not None:
|
||||
try:
|
||||
cons = ForeignKeyConstraint([Job_table.c.library_folder_id],
|
||||
[LibraryFolder_table.c.id],
|
||||
name='job_library_folder_id_fk')
|
||||
[LibraryFolder_table.c.id],
|
||||
name='job_library_folder_id_fk')
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception:
|
||||
|
||||
@@ -12,10 +12,10 @@ metadata = MetaData()
|
||||
|
||||
# New table to support user preferences.
|
||||
UserPreference_table = Table("user_preference", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("name", Unicode(255), index=True),
|
||||
Column("value", Unicode(1024)))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("name", Unicode(255), index=True),
|
||||
Column("value", Unicode(1024)))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -14,22 +14,22 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
Visualization_table = Table("visualization", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("latest_revision_id", Integer,
|
||||
ForeignKey("visualization_revision.id", use_alter=True, name='visualization_latest_revision_id_fk'), index=True),
|
||||
Column("title", TEXT),
|
||||
Column("type", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("latest_revision_id", Integer,
|
||||
ForeignKey("visualization_revision.id", use_alter=True, name='visualization_latest_revision_id_fk'), index=True),
|
||||
Column("title", TEXT),
|
||||
Column("type", TEXT))
|
||||
|
||||
VisualizationRevision_table = Table("visualization_revision", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True, nullable=False),
|
||||
Column("title", TEXT),
|
||||
Column("config", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True, nullable=False),
|
||||
Column("title", TEXT),
|
||||
Column("config", TEXT))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -48,8 +48,8 @@ def upgrade(migrate_engine):
|
||||
if User_table is not None and FormValues_table is not None:
|
||||
try:
|
||||
cons = ForeignKeyConstraint([User_table.c.form_values_id],
|
||||
[FormValues_table.c.id],
|
||||
name='user_form_values_id_fk')
|
||||
[FormValues_table.c.id],
|
||||
name='user_form_values_id_fk')
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception:
|
||||
|
||||
@@ -13,113 +13,113 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
CloudImage_table = Table("cloud_image", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("provider_type", TEXT),
|
||||
Column("image_id", TEXT, nullable=False),
|
||||
Column("manifest", TEXT),
|
||||
Column("state", TEXT),
|
||||
Column("architecture", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("provider_type", TEXT),
|
||||
Column("image_id", TEXT, nullable=False),
|
||||
Column("manifest", TEXT),
|
||||
Column("state", TEXT),
|
||||
Column("architecture", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
""" UserConfiguredInstance (UCI) table """
|
||||
UCI_table = Table("cloud_uci", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("credentials_id", Integer, ForeignKey("cloud_user_credentials.id"), index=True),
|
||||
Column("key_pair_name", TEXT),
|
||||
Column("key_pair_material", TEXT),
|
||||
Column("name", TEXT),
|
||||
Column("state", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("total_size", Integer),
|
||||
Column("launch_time", DateTime),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("credentials_id", Integer, ForeignKey("cloud_user_credentials.id"), index=True),
|
||||
Column("key_pair_name", TEXT),
|
||||
Column("key_pair_material", TEXT),
|
||||
Column("name", TEXT),
|
||||
Column("state", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("total_size", Integer),
|
||||
Column("launch_time", DateTime),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
CloudInstance_table = Table("cloud_instance", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("launch_time", DateTime),
|
||||
Column("stop_time", DateTime),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True),
|
||||
Column("type", TEXT),
|
||||
Column("reservation_id", TEXT),
|
||||
Column("instance_id", TEXT),
|
||||
Column("mi_id", Integer, ForeignKey("cloud_image.id"), index=True),
|
||||
Column("state", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("public_dns", TEXT),
|
||||
Column("private_dns", TEXT),
|
||||
Column("security_group", TEXT),
|
||||
Column("availability_zone", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("launch_time", DateTime),
|
||||
Column("stop_time", DateTime),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True),
|
||||
Column("type", TEXT),
|
||||
Column("reservation_id", TEXT),
|
||||
Column("instance_id", TEXT),
|
||||
Column("mi_id", Integer, ForeignKey("cloud_image.id"), index=True),
|
||||
Column("state", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("public_dns", TEXT),
|
||||
Column("private_dns", TEXT),
|
||||
Column("security_group", TEXT),
|
||||
Column("availability_zone", TEXT))
|
||||
|
||||
CloudStore_table = Table("cloud_store", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("attach_time", DateTime),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True, nullable=False),
|
||||
Column("volume_id", TEXT),
|
||||
Column("size", Integer, nullable=False),
|
||||
Column("availability_zone", TEXT),
|
||||
Column("inst_id", Integer, ForeignKey("cloud_instance.id")),
|
||||
Column("status", TEXT),
|
||||
Column("device", TEXT),
|
||||
Column("space_consumed", Integer),
|
||||
Column("error", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("attach_time", DateTime),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True, nullable=False),
|
||||
Column("volume_id", TEXT),
|
||||
Column("size", Integer, nullable=False),
|
||||
Column("availability_zone", TEXT),
|
||||
Column("inst_id", Integer, ForeignKey("cloud_instance.id")),
|
||||
Column("status", TEXT),
|
||||
Column("device", TEXT),
|
||||
Column("space_consumed", Integer),
|
||||
Column("error", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
CloudSnapshot_table = Table("cloud_snapshot", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True),
|
||||
Column("store_id", Integer, ForeignKey("cloud_store.id"), index=True, nullable=False),
|
||||
Column("snapshot_id", TEXT),
|
||||
Column("status", TEXT),
|
||||
Column("description", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True),
|
||||
Column("store_id", Integer, ForeignKey("cloud_store.id"), index=True, nullable=False),
|
||||
Column("snapshot_id", TEXT),
|
||||
Column("status", TEXT),
|
||||
Column("description", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
CloudUserCredentials_table = Table("cloud_user_credentials", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("provider_id", Integer, ForeignKey("cloud_provider.id"), index=True, nullable=False),
|
||||
Column("name", TEXT),
|
||||
Column("access_key", TEXT),
|
||||
Column("secret_key", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("provider_id", Integer, ForeignKey("cloud_provider.id"), index=True, nullable=False),
|
||||
Column("name", TEXT),
|
||||
Column("access_key", TEXT),
|
||||
Column("secret_key", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
CloudProvider_table = Table("cloud_provider", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("type", TEXT, nullable=False),
|
||||
Column("name", TEXT),
|
||||
Column("region_connection", TEXT),
|
||||
Column("region_name", TEXT),
|
||||
Column("region_endpoint", TEXT),
|
||||
Column("is_secure", Boolean),
|
||||
Column("host", TEXT),
|
||||
Column("port", Integer),
|
||||
Column("proxy", TEXT),
|
||||
Column("proxy_port", TEXT),
|
||||
Column("proxy_user", TEXT),
|
||||
Column("proxy_pass", TEXT),
|
||||
Column("debug", Integer),
|
||||
Column("https_connection_factory", TEXT),
|
||||
Column("path", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("type", TEXT, nullable=False),
|
||||
Column("name", TEXT),
|
||||
Column("region_connection", TEXT),
|
||||
Column("region_name", TEXT),
|
||||
Column("region_endpoint", TEXT),
|
||||
Column("is_secure", Boolean),
|
||||
Column("host", TEXT),
|
||||
Column("port", Integer),
|
||||
Column("proxy", TEXT),
|
||||
Column("proxy_port", TEXT),
|
||||
Column("proxy_user", TEXT),
|
||||
Column("proxy_pass", TEXT),
|
||||
Column("debug", Integer),
|
||||
Column("https_connection_factory", TEXT),
|
||||
Column("path", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -14,13 +14,13 @@ metadata = MetaData()
|
||||
|
||||
# New table to store user actions.
|
||||
UserAction_table = Table("user_action", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("session_id", Integer, ForeignKey("galaxy_session.id"), index=True),
|
||||
Column("action", Unicode(255)),
|
||||
Column("context", Unicode(512)),
|
||||
Column("params", Unicode(1024)))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("session_id", Integer, ForeignKey("galaxy_session.id"), index=True),
|
||||
Column("action", Unicode(255)),
|
||||
Column("context", Unicode(512)),
|
||||
Column("params", Unicode(1024)))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -12,22 +12,22 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
StoredWorkflowTagAssociation_table = Table("stored_workflow_tag_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("stored_workflow_id", Integer, ForeignKey("stored_workflow.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("user_tname", Unicode(255), index=True),
|
||||
Column("value", Unicode(255), index=True),
|
||||
Column("user_value", Unicode(255), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("stored_workflow_id", Integer, ForeignKey("stored_workflow.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("user_tname", Unicode(255), index=True),
|
||||
Column("value", Unicode(255), index=True),
|
||||
Column("user_value", Unicode(255), index=True))
|
||||
|
||||
WorkflowTagAssociation_table = Table("workflow_tag_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("workflow_id", Integer, ForeignKey("workflow.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("user_tname", Unicode(255), index=True),
|
||||
Column("value", Unicode(255), index=True),
|
||||
Column("user_value", Unicode(255), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("workflow_id", Integer, ForeignKey("workflow.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("user_tname", Unicode(255), index=True),
|
||||
Column("value", Unicode(255), index=True),
|
||||
Column("user_value", Unicode(255), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -11,9 +11,9 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
PageUserShareAssociation_table = Table("page_user_share_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -13,39 +13,39 @@ metadata = MetaData()
|
||||
# Annotation tables.
|
||||
|
||||
HistoryAnnotationAssociation_table = Table("history_annotation_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT))
|
||||
|
||||
HistoryDatasetAssociationAnnotationAssociation_table = Table("history_dataset_association_annotation_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT))
|
||||
|
||||
StoredWorkflowAnnotationAssociation_table = Table("stored_workflow_annotation_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("stored_workflow_id", Integer, ForeignKey("stored_workflow.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("stored_workflow_id", Integer, ForeignKey("stored_workflow.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT))
|
||||
|
||||
WorkflowStepAnnotationAssociation_table = Table("workflow_step_annotation_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT))
|
||||
|
||||
# Tagging tables.
|
||||
|
||||
WorkflowStepTagAssociation_table = Table("workflow_step_tag_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("user_tname", Unicode(255), index=True),
|
||||
Column("value", Unicode(255), index=True),
|
||||
Column("user_value", Unicode(255), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("user_tname", Unicode(255), index=True),
|
||||
Column("value", Unicode(255), index=True),
|
||||
Column("user_value", Unicode(255), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -59,15 +59,15 @@ def upgrade(migrate_engine):
|
||||
if migrate_engine.name == 'sqlite':
|
||||
# create a temporary table
|
||||
RequestTemp_table = Table('request_temp', metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("name", TrimmedString(255), nullable=False),
|
||||
Column("desc", TEXT),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("deleted", Boolean, index=True, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("name", TrimmedString(255), nullable=False),
|
||||
Column("desc", TEXT),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("deleted", Boolean, index=True, default=False))
|
||||
try:
|
||||
RequestTemp_table.create()
|
||||
except Exception:
|
||||
|
||||
+9
-9
@@ -41,15 +41,15 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect(only=['form_values', 'request_type', 'galaxy_user'])
|
||||
# create a temporary table
|
||||
Request_table = Table('request', metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("name", TrimmedString(255), nullable=False),
|
||||
Column("desc", TEXT),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("deleted", Boolean, index=True, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("name", TrimmedString(255), nullable=False),
|
||||
Column("desc", TEXT),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("deleted", Boolean, index=True, default=False))
|
||||
try:
|
||||
Request_table.create()
|
||||
except Exception:
|
||||
|
||||
@@ -11,10 +11,10 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
PageAnnotationAssociation_table = Table("page_annotation_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT, index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT, index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -14,18 +14,18 @@ now = datetime.datetime.utcnow
|
||||
metadata = MetaData()
|
||||
|
||||
WorkflowInvocation_table = Table("workflow_invocation", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("workflow_id", Integer, ForeignKey("workflow.id"), index=True, nullable=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("workflow_id", Integer, ForeignKey("workflow.id"), index=True, nullable=False))
|
||||
|
||||
WorkflowInvocationStep_table = Table("workflow_invocation_step", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("workflow_invocation_id", Integer, ForeignKey("workflow_invocation.id"), index=True, nullable=False),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True, nullable=False),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True, nullable=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("workflow_invocation_id", Integer, ForeignKey("workflow_invocation.id"), index=True, nullable=False),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True, nullable=False),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True, nullable=False))
|
||||
|
||||
tables = [WorkflowInvocation_table, WorkflowInvocationStep_table]
|
||||
|
||||
|
||||
@@ -30,18 +30,18 @@ def upgrade(migrate_engine):
|
||||
|
||||
# 2) Readd
|
||||
WorkflowInvocation_table = Table("workflow_invocation", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("workflow_id", Integer, ForeignKey("workflow.id"), index=True, nullable=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("workflow_id", Integer, ForeignKey("workflow.id"), index=True, nullable=False))
|
||||
|
||||
WorkflowInvocationStep_table = Table("workflow_invocation_step", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("workflow_invocation_id", Integer, ForeignKey("workflow_invocation.id"), index=True, nullable=False),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True, nullable=False),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True, nullable=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("workflow_invocation_id", Integer, ForeignKey("workflow_invocation.id"), index=True, nullable=False),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True, nullable=False),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True, nullable=True))
|
||||
|
||||
for table in [WorkflowInvocation_table, WorkflowInvocationStep_table]:
|
||||
try:
|
||||
|
||||
+14
-14
@@ -13,28 +13,28 @@ metadata = MetaData()
|
||||
# Sharing visualizations.
|
||||
|
||||
VisualizationUserShareAssociation_table = Table("visualization_user_share_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True))
|
||||
|
||||
# Tagging visualizations.
|
||||
|
||||
VisualizationTagAssociation_table = Table("visualization_tag_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("user_tname", Unicode(255), index=True),
|
||||
Column("value", Unicode(255), index=True),
|
||||
Column("user_value", Unicode(255), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True),
|
||||
Column("tag_id", Integer, ForeignKey("tag.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("user_tname", Unicode(255), index=True),
|
||||
Column("value", Unicode(255), index=True),
|
||||
Column("user_value", Unicode(255), index=True))
|
||||
|
||||
# Annotating visualizations.
|
||||
|
||||
VisualizationAnnotationAssociation_table = Table("visualization_annotation_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT, index=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("annotation", TEXT, index=False))
|
||||
|
||||
|
||||
def engine_false(migrate_engine):
|
||||
|
||||
@@ -13,12 +13,12 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
RequestTypePermissions_table = Table("request_type_permissions", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("action", TEXT),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), nullable=True, index=True),
|
||||
Column("role_id", Integer, ForeignKey("role.id"), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("action", TEXT),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), nullable=True, index=True),
|
||||
Column("role_id", Integer, ForeignKey("role.id"), index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -15,10 +15,10 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
APIKeys_table = Table("api_keys", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("key", TrimmedString(32), index=True, unique=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("key", TrimmedString(32), index=True, unique=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -13,113 +13,113 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
CloudImage_table = Table("cloud_image", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("provider_type", TEXT),
|
||||
Column("image_id", TEXT, nullable=False),
|
||||
Column("manifest", TEXT),
|
||||
Column("state", TEXT),
|
||||
Column("architecture", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("provider_type", TEXT),
|
||||
Column("image_id", TEXT, nullable=False),
|
||||
Column("manifest", TEXT),
|
||||
Column("state", TEXT),
|
||||
Column("architecture", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
""" UserConfiguredInstance (UCI) table """
|
||||
UCI_table = Table("cloud_uci", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("credentials_id", Integer, ForeignKey("cloud_user_credentials.id"), index=True),
|
||||
Column("key_pair_name", TEXT),
|
||||
Column("key_pair_material", TEXT),
|
||||
Column("name", TEXT),
|
||||
Column("state", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("total_size", Integer),
|
||||
Column("launch_time", DateTime),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("credentials_id", Integer, ForeignKey("cloud_user_credentials.id"), index=True),
|
||||
Column("key_pair_name", TEXT),
|
||||
Column("key_pair_material", TEXT),
|
||||
Column("name", TEXT),
|
||||
Column("state", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("total_size", Integer),
|
||||
Column("launch_time", DateTime),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
CloudInstance_table = Table("cloud_instance", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("launch_time", DateTime),
|
||||
Column("stop_time", DateTime),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True),
|
||||
Column("type", TEXT),
|
||||
Column("reservation_id", TEXT),
|
||||
Column("instance_id", TEXT),
|
||||
Column("mi_id", Integer, ForeignKey("cloud_image.id"), index=True),
|
||||
Column("state", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("public_dns", TEXT),
|
||||
Column("private_dns", TEXT),
|
||||
Column("security_group", TEXT),
|
||||
Column("availability_zone", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("launch_time", DateTime),
|
||||
Column("stop_time", DateTime),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True),
|
||||
Column("type", TEXT),
|
||||
Column("reservation_id", TEXT),
|
||||
Column("instance_id", TEXT),
|
||||
Column("mi_id", Integer, ForeignKey("cloud_image.id"), index=True),
|
||||
Column("state", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("public_dns", TEXT),
|
||||
Column("private_dns", TEXT),
|
||||
Column("security_group", TEXT),
|
||||
Column("availability_zone", TEXT))
|
||||
|
||||
CloudStore_table = Table("cloud_store", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("attach_time", DateTime),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True, nullable=False),
|
||||
Column("volume_id", TEXT),
|
||||
Column("size", Integer, nullable=False),
|
||||
Column("availability_zone", TEXT),
|
||||
Column("inst_id", Integer, ForeignKey("cloud_instance.id")),
|
||||
Column("status", TEXT),
|
||||
Column("device", TEXT),
|
||||
Column("space_consumed", Integer),
|
||||
Column("error", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("attach_time", DateTime),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True, nullable=False),
|
||||
Column("volume_id", TEXT),
|
||||
Column("size", Integer, nullable=False),
|
||||
Column("availability_zone", TEXT),
|
||||
Column("inst_id", Integer, ForeignKey("cloud_instance.id")),
|
||||
Column("status", TEXT),
|
||||
Column("device", TEXT),
|
||||
Column("space_consumed", Integer),
|
||||
Column("error", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
CloudSnapshot_table = Table("cloud_snapshot", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True),
|
||||
Column("store_id", Integer, ForeignKey("cloud_store.id"), index=True, nullable=False),
|
||||
Column("snapshot_id", TEXT),
|
||||
Column("status", TEXT),
|
||||
Column("description", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("uci_id", Integer, ForeignKey("cloud_uci.id"), index=True),
|
||||
Column("store_id", Integer, ForeignKey("cloud_store.id"), index=True, nullable=False),
|
||||
Column("snapshot_id", TEXT),
|
||||
Column("status", TEXT),
|
||||
Column("description", TEXT),
|
||||
Column("error", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
CloudUserCredentials_table = Table("cloud_user_credentials", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("provider_id", Integer, ForeignKey("cloud_provider.id"), index=True, nullable=False),
|
||||
Column("name", TEXT),
|
||||
Column("access_key", TEXT),
|
||||
Column("secret_key", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("provider_id", Integer, ForeignKey("cloud_provider.id"), index=True, nullable=False),
|
||||
Column("name", TEXT),
|
||||
Column("access_key", TEXT),
|
||||
Column("secret_key", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
CloudProvider_table = Table("cloud_provider", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("type", TEXT, nullable=False),
|
||||
Column("name", TEXT),
|
||||
Column("region_connection", TEXT),
|
||||
Column("region_name", TEXT),
|
||||
Column("region_endpoint", TEXT),
|
||||
Column("is_secure", Boolean),
|
||||
Column("host", TEXT),
|
||||
Column("port", Integer),
|
||||
Column("proxy", TEXT),
|
||||
Column("proxy_port", TEXT),
|
||||
Column("proxy_user", TEXT),
|
||||
Column("proxy_pass", TEXT),
|
||||
Column("debug", Integer),
|
||||
Column("https_connection_factory", TEXT),
|
||||
Column("path", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True, nullable=False),
|
||||
Column("type", TEXT, nullable=False),
|
||||
Column("name", TEXT),
|
||||
Column("region_connection", TEXT),
|
||||
Column("region_name", TEXT),
|
||||
Column("region_endpoint", TEXT),
|
||||
Column("is_secure", Boolean),
|
||||
Column("host", TEXT),
|
||||
Column("port", Integer),
|
||||
Column("proxy", TEXT),
|
||||
Column("proxy_port", TEXT),
|
||||
Column("proxy_user", TEXT),
|
||||
Column("proxy_pass", TEXT),
|
||||
Column("debug", Integer),
|
||||
Column("https_connection_factory", TEXT),
|
||||
Column("path", TEXT),
|
||||
Column("deleted", Boolean, default=False))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -67,14 +67,14 @@ def upgrade(migrate_engine):
|
||||
if isinstance(df, dict):
|
||||
cmd = "INSERT INTO sample_dataset VALUES (%s, %s, %s, %s, '%s', '%s', '%s', '%s', '%s')"
|
||||
cmd = cmd % (nextval(migrate_engine, 'sample_dataset'),
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
str(sample_id),
|
||||
df.get('name', ''),
|
||||
df.get('filepath', ''),
|
||||
df.get('status', '').replace('"', '').replace("'", ""),
|
||||
"",
|
||||
df.get('size', '').replace('"', '').replace("'", "").replace(df.get('filepath', ''), '').strip())
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
str(sample_id),
|
||||
df.get('name', ''),
|
||||
df.get('filepath', ''),
|
||||
df.get('status', '').replace('"', '').replace("'", ""),
|
||||
"",
|
||||
df.get('size', '').replace('"', '').replace("'", "").replace(df.get('filepath', ''), '').strip())
|
||||
migrate_engine.execute(cmd)
|
||||
|
||||
# Delete the dataset_files column in the Sample table
|
||||
|
||||
@@ -13,35 +13,35 @@ metadata = MetaData()
|
||||
# Rating tables.
|
||||
|
||||
HistoryRatingAssociation_table = Table("history_rating_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
|
||||
HistoryDatasetAssociationRatingAssociation_table = Table("history_dataset_association_rating_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("history_dataset_association_id", Integer, ForeignKey("history_dataset_association.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
|
||||
StoredWorkflowRatingAssociation_table = Table("stored_workflow_rating_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("stored_workflow_id", Integer, ForeignKey("stored_workflow.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
|
||||
PageRatingAssociation_table = Table("page_rating_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
|
||||
VisualizationRatingAssociation_table = Table("visualization_rating_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True),
|
||||
Column("stored_workflow_id", Integer, ForeignKey("stored_workflow.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
|
||||
PageRatingAssociation_table = Table("page_rating_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("page_id", Integer, ForeignKey("page.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
|
||||
VisualizationRatingAssociation_table = Table("visualization_rating_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("visualization_id", Integer, ForeignKey("visualization.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("rating", Integer, index=True))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
metadata.bind = migrate_engine
|
||||
|
||||
@@ -13,9 +13,9 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
WorkflowOutput_table = Table("workflow_output", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True, nullable=False),
|
||||
Column("output_name", String(255), nullable=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("workflow_step_id", Integer, ForeignKey("workflow_step.id"), index=True, nullable=False),
|
||||
Column("output_name", String(255), nullable=True))
|
||||
|
||||
tables = [WorkflowOutput_table]
|
||||
|
||||
|
||||
@@ -13,14 +13,14 @@ metadata = MetaData()
|
||||
# Table to add.
|
||||
|
||||
JobExportHistoryArchive_table = Table("job_export_history_archive", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("dataset_id", Integer, ForeignKey("dataset.id"), index=True),
|
||||
Column("compressed", Boolean, index=True, default=False),
|
||||
Column("history_attrs_filename", TEXT),
|
||||
Column("datasets_attrs_filename", TEXT),
|
||||
Column("jobs_attrs_filename", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("dataset_id", Integer, ForeignKey("dataset.id"), index=True),
|
||||
Column("compressed", Boolean, index=True, default=False),
|
||||
Column("history_attrs_filename", TEXT),
|
||||
Column("datasets_attrs_filename", TEXT),
|
||||
Column("jobs_attrs_filename", TEXT))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -19,10 +19,10 @@ ldda_parent_col = Column("ldda_parent_id", Integer, ForeignKey("library_dataset_
|
||||
# Table to add.
|
||||
|
||||
JobImportHistoryArchive_table = Table("job_import_history_archive", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("archive_dir", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True),
|
||||
Column("history_id", Integer, ForeignKey("history.id"), index=True),
|
||||
Column("archive_dir", TEXT))
|
||||
|
||||
|
||||
def engine_false(migrate_engine):
|
||||
|
||||
@@ -13,21 +13,21 @@ metadata = MetaData()
|
||||
now = datetime.datetime.utcnow
|
||||
|
||||
Task_table = Table("task", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("execution_time", DateTime),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("state", String(64), index=True),
|
||||
Column("command_line", TEXT),
|
||||
Column("param_filename", String(1024)),
|
||||
Column("runner_name", String(255)),
|
||||
Column("stdout", TEXT),
|
||||
Column("stderr", TEXT),
|
||||
Column("traceback", TEXT),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True, nullable=False),
|
||||
Column("part_file", String(1024)),
|
||||
Column("task_runner_name", String(255)),
|
||||
Column("task_runner_external_id", String(255)))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("execution_time", DateTime),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("state", String(64), index=True),
|
||||
Column("command_line", TEXT),
|
||||
Column("param_filename", String(1024)),
|
||||
Column("runner_name", String(255)),
|
||||
Column("stdout", TEXT),
|
||||
Column("stderr", TEXT),
|
||||
Column("traceback", TEXT),
|
||||
Column("job_id", Integer, ForeignKey("job.id"), index=True, nullable=False),
|
||||
Column("part_file", String(1024)),
|
||||
Column("task_runner_name", String(255)),
|
||||
Column("task_runner_external_id", String(255)))
|
||||
|
||||
tables = [Task_table]
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@ metadata = MetaData()
|
||||
# Table to add
|
||||
|
||||
UserOpenID_table = Table("galaxy_user_openid", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, index=True, default=now, onupdate=now),
|
||||
Column("session_id", Integer, ForeignKey("galaxy_session.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("openid", TEXT))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, index=True, default=now, onupdate=now),
|
||||
Column("session_id", Integer, ForeignKey("galaxy_session.id"), index=True),
|
||||
Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True),
|
||||
Column("openid", TEXT))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -16,16 +16,16 @@ metadata = MetaData()
|
||||
|
||||
# Table to add
|
||||
Sequencer_table = Table('sequencer', metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("name", TrimmedString(255), nullable=False),
|
||||
Column("description", TEXT),
|
||||
Column("sequencer_type_id", TrimmedString(255), nullable=False),
|
||||
Column("version", TrimmedString(255)),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True),
|
||||
Column("deleted", Boolean, index=True, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("name", TrimmedString(255), nullable=False),
|
||||
Column("description", TEXT),
|
||||
Column("sequencer_type_id", TrimmedString(255), nullable=False),
|
||||
Column("version", TrimmedString(255)),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True),
|
||||
Column("deleted", Boolean, index=True, default=False))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
+12
-12
@@ -13,22 +13,22 @@ log = logging.getLogger(__name__)
|
||||
metadata = MetaData()
|
||||
|
||||
Run_table = Table("run", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True),
|
||||
Column("deleted", Boolean, index=True, default=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("form_definition_id", Integer, ForeignKey("form_definition.id"), index=True),
|
||||
Column("form_values_id", Integer, ForeignKey("form_values.id"), index=True),
|
||||
Column("deleted", Boolean, index=True, default=False))
|
||||
|
||||
RequestTypeRunAssociation_table = Table("request_type_run_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), index=True, nullable=False),
|
||||
Column("run_id", Integer, ForeignKey("run.id"), index=True, nullable=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), index=True, nullable=False),
|
||||
Column("run_id", Integer, ForeignKey("run.id"), index=True, nullable=False))
|
||||
|
||||
SampleRunAssociation_table = Table("sample_run_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("sample_id", Integer, ForeignKey("sample.id"), index=True, nullable=False),
|
||||
Column("run_id", Integer, ForeignKey("run.id"), index=True, nullable=False))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("sample_id", Integer, ForeignKey("sample.id"), index=True, nullable=False),
|
||||
Column("run_id", Integer, ForeignKey("run.id"), index=True, nullable=False))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -18,20 +18,20 @@ metadata = MetaData()
|
||||
# Table to add
|
||||
|
||||
DeferredJob_table = Table("deferred_job", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("state", String(64), index=True),
|
||||
Column("plugin", String(128), index=True),
|
||||
Column("params", JSONType))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("state", String(64), index=True),
|
||||
Column("plugin", String(128), index=True),
|
||||
Column("params", JSONType))
|
||||
|
||||
TransferJob_table = Table("transfer_job", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("state", String(64), index=True),
|
||||
Column("path", String(1024)),
|
||||
Column("params", JSONType))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("create_time", DateTime, default=now),
|
||||
Column("update_time", DateTime, default=now, onupdate=now),
|
||||
Column("state", String(64), index=True),
|
||||
Column("path", String(1024)),
|
||||
Column("params", JSONType))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
||||
@@ -65,10 +65,10 @@ def create_sequencer_form_definition(migrate_engine):
|
||||
# create new form_definition_current in the db
|
||||
cmd = "INSERT INTO form_definition_current VALUES ( %s, %s, %s, %s, %s )"
|
||||
cmd = cmd % (nextval(migrate_engine, 'form_definition_current'),
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
'NULL',
|
||||
boolean(migrate_engine, 'false'))
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
'NULL',
|
||||
boolean(migrate_engine, 'false'))
|
||||
migrate_engine.execute(cmd)
|
||||
# get this form_definition_current id
|
||||
form_definition_current_id = get_latest_id(migrate_engine, 'form_definition_current')
|
||||
@@ -77,43 +77,43 @@ def create_sequencer_form_definition(migrate_engine):
|
||||
form_definition_desc = ''
|
||||
form_definition_fields = []
|
||||
fields = [('Host', 'TextField'),
|
||||
('User name', 'TextField'),
|
||||
('Password', 'PasswordField'),
|
||||
('Data directory', 'TextField')]
|
||||
('User name', 'TextField'),
|
||||
('Password', 'PasswordField'),
|
||||
('Data directory', 'TextField')]
|
||||
for index, (label, field_type) in enumerate(fields):
|
||||
form_definition_fields.append({'name': 'field_%i' % index,
|
||||
'label': label,
|
||||
'helptext': '',
|
||||
'visible': True,
|
||||
'required': False,
|
||||
'type': field_type,
|
||||
'selectlist': [],
|
||||
'layout': 'none',
|
||||
'default': ''})
|
||||
'label': label,
|
||||
'helptext': '',
|
||||
'visible': True,
|
||||
'required': False,
|
||||
'type': field_type,
|
||||
'selectlist': [],
|
||||
'layout': 'none',
|
||||
'default': ''})
|
||||
form_definition_fields.append({'name': 'field_%i' % len(fields),
|
||||
'label': 'Prepend the experiment name and sample name to the dataset name?',
|
||||
'helptext': 'Galaxy datasets are renamed by prepending the experiment name and sample name to the dataset name, ensuring dataset names remain unique in Galaxy even when multiple datasets have the same name on the sequencer.',
|
||||
'visible': True,
|
||||
'required': False,
|
||||
'type': 'SelectField',
|
||||
'selectlist': ['Do not rename',
|
||||
'Preprend sample name',
|
||||
'Prepend experiment name',
|
||||
'Prepend experiment and sample name'],
|
||||
'layout': 'none',
|
||||
'default': ''})
|
||||
'label': 'Prepend the experiment name and sample name to the dataset name?',
|
||||
'helptext': 'Galaxy datasets are renamed by prepending the experiment name and sample name to the dataset name, ensuring dataset names remain unique in Galaxy even when multiple datasets have the same name on the sequencer.',
|
||||
'visible': True,
|
||||
'required': False,
|
||||
'type': 'SelectField',
|
||||
'selectlist': ['Do not rename',
|
||||
'Preprend sample name',
|
||||
'Prepend experiment name',
|
||||
'Prepend experiment and sample name'],
|
||||
'layout': 'none',
|
||||
'default': ''})
|
||||
form_definition_type = 'Sequencer Information Form'
|
||||
form_definition_layout = dumps('[]')
|
||||
cmd = "INSERT INTO form_definition VALUES ( %s, %s, %s, '%s', '%s', %s, '%s', '%s', '%s' )"
|
||||
cmd = cmd % (nextval(migrate_engine, 'form_definition'),
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
form_definition_name,
|
||||
form_definition_desc,
|
||||
form_definition_current_id,
|
||||
dumps(form_definition_fields),
|
||||
form_definition_type,
|
||||
form_definition_layout)
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
form_definition_name,
|
||||
form_definition_desc,
|
||||
form_definition_current_id,
|
||||
dumps(form_definition_fields),
|
||||
form_definition_type,
|
||||
form_definition_layout)
|
||||
migrate_engine.execute(cmd)
|
||||
# get this form_definition id
|
||||
form_definition_id = get_latest_id(migrate_engine, 'form_definition')
|
||||
@@ -150,15 +150,15 @@ def add_sequencer(migrate_engine, sequencer_index, sequencer_form_definition_id,
|
||||
'''Adds a new sequencer to the sequencer table along with its form values.'''
|
||||
# Create a new form values record with the supplied sequencer information
|
||||
values = dumps({'field_0': sequencer_info.get('host', ''),
|
||||
'field_1': sequencer_info.get('username', ''),
|
||||
'field_2': sequencer_info.get('password', ''),
|
||||
'field_3': sequencer_info.get('data_dir', ''),
|
||||
'field_4': sequencer_info.get('rename_dataset', '')})
|
||||
'field_1': sequencer_info.get('username', ''),
|
||||
'field_2': sequencer_info.get('password', ''),
|
||||
'field_3': sequencer_info.get('data_dir', ''),
|
||||
'field_4': sequencer_info.get('rename_dataset', '')})
|
||||
cmd = "INSERT INTO form_values VALUES ( %s, %s, %s, %s, '%s' )" % (nextval(migrate_engine, 'form_values'),
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
sequencer_form_definition_id,
|
||||
values)
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
sequencer_form_definition_id,
|
||||
values)
|
||||
migrate_engine.execute(cmd)
|
||||
sequencer_form_values_id = get_latest_id(migrate_engine, 'form_values')
|
||||
# Create a new sequencer record with reference to the form value created above.
|
||||
@@ -168,15 +168,15 @@ def add_sequencer(migrate_engine, sequencer_index, sequencer_form_definition_id,
|
||||
sequencer_type_id = 'simple_unknown_sequencer'
|
||||
cmd = "INSERT INTO sequencer VALUES ( %s, %s, %s, '%s', '%s', '%s', '%s', %s, %s, %s )"
|
||||
cmd = cmd % (nextval(migrate_engine, 'sequencer'),
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
name,
|
||||
desc,
|
||||
sequencer_type_id,
|
||||
version,
|
||||
sequencer_form_definition_id,
|
||||
sequencer_form_values_id,
|
||||
boolean(migrate_engine, 'false'))
|
||||
localtimestamp(migrate_engine),
|
||||
localtimestamp(migrate_engine),
|
||||
name,
|
||||
desc,
|
||||
sequencer_type_id,
|
||||
version,
|
||||
sequencer_form_definition_id,
|
||||
sequencer_form_values_id,
|
||||
boolean(migrate_engine, 'false'))
|
||||
migrate_engine.execute(cmd)
|
||||
return get_latest_id(migrate_engine, 'sequencer')
|
||||
|
||||
@@ -281,10 +281,10 @@ def downgrade(migrate_engine):
|
||||
seq_values = loads(str(row[1]))
|
||||
# create the datatx_info json dict
|
||||
datatx_info = dumps(dict(host=seq_values.get('field_0', ''),
|
||||
username=seq_values.get('field_1', ''),
|
||||
password=seq_values.get('field_2', ''),
|
||||
data_dir=seq_values.get('field_3', ''),
|
||||
rename_dataset=seq_values.get('field_4', '')))
|
||||
username=seq_values.get('field_1', ''),
|
||||
password=seq_values.get('field_2', ''),
|
||||
data_dir=seq_values.get('field_3', ''),
|
||||
rename_dataset=seq_values.get('field_4', '')))
|
||||
# update the column
|
||||
cmd = "UPDATE request_type SET datatx_info='%s' WHERE id=%i" % (datatx_info, request_type_id)
|
||||
migrate_engine.execute(cmd)
|
||||
|
||||
@@ -51,8 +51,8 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
Sequencer_table = Table("sequencer", metadata, autoload=True)
|
||||
cons = ForeignKeyConstraint([SampleDataset_table.c.external_service_id],
|
||||
[Sequencer_table.c.id],
|
||||
name='sample_dataset_external_services_id_fk')
|
||||
[Sequencer_table.c.id],
|
||||
name='sample_dataset_external_services_id_fk')
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception:
|
||||
@@ -97,9 +97,9 @@ def upgrade(migrate_engine):
|
||||
log.exception("Deleting column 'sequencer_type_id' from the 'external_service' table failed.")
|
||||
# create 'request_type_external_service_association' table
|
||||
RequestTypeExternalServiceAssociation_table = Table("request_type_external_service_association", metadata,
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), index=True),
|
||||
Column("external_service_id", Integer, ForeignKey("external_service.id"), index=True))
|
||||
Column("id", Integer, primary_key=True),
|
||||
Column("request_type_id", Integer, ForeignKey("request_type.id"), index=True),
|
||||
Column("external_service_id", Integer, ForeignKey("external_service.id"), index=True))
|
||||
try:
|
||||
RequestTypeExternalServiceAssociation_table.create()
|
||||
except Exception:
|
||||
@@ -124,8 +124,8 @@ def upgrade(migrate_engine):
|
||||
sequencer_id = 'null'
|
||||
cmd = "INSERT INTO request_type_external_service_association VALUES ( %s, %s, %s )"
|
||||
cmd = cmd % (nextval(migrate_engine, 'request_type_external_service_association'),
|
||||
request_type_id,
|
||||
sequencer_id)
|
||||
request_type_id,
|
||||
sequencer_id)
|
||||
migrate_engine.execute(cmd)
|
||||
# drop the 'sequencer_id' column in the 'request_type' table
|
||||
try:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user