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:
Nicola Soranzo
2017-08-17 11:35:39 +01:00
committed by Nicola Soranzo
parent 21b44bf348
commit a353b2e88f
417 changed files with 14946 additions and 14946 deletions
@@ -37,9 +37,9 @@ def main(options):
revision_data['owner'] = options.owner
revision_url = '%s%s' % (options.local_url.rstrip('/'), '/api/tool_shed_repositories/get_latest_installable_revision')
latest_installable_revision = submit(options.api,
revision_url,
revision_data,
return_formatted=False)
revision_url,
revision_data,
return_formatted=False)
data['changeset_revision'] = latest_installable_revision
if options.tool_panel_section_id:
data['tool_panel_section_id'] = options.tool_panel_section_id
+37 -37
View File
@@ -88,8 +88,8 @@ def main():
ini_file = args[0]
if not (options.purge_folders ^ options.delete_userless_histories ^
options.purge_libraries ^ options.purge_histories ^
options.purge_datasets ^ options.delete_datasets):
options.purge_libraries ^ options.purge_histories ^
options.purge_datasets ^ options.delete_datasets):
parser.print_help()
sys.exit(0)
@@ -144,12 +144,12 @@ def delete_userless_histories(app, cutoff_time, info_only=False, force_retry=Fal
if force_retry:
histories = app.sa_session.query(app.model.History) \
.filter(and_(app.model.History.table.c.user_id == null(),
app.model.History.table.c.update_time < cutoff_time))
app.model.History.table.c.update_time < cutoff_time))
else:
histories = app.sa_session.query(app.model.History) \
.filter(and_(app.model.History.table.c.user_id == null(),
app.model.History.table.c.deleted == false(),
app.model.History.table.c.update_time < cutoff_time))
app.model.History.table.c.deleted == false(),
app.model.History.table.c.update_time < cutoff_time))
for history in histories:
if not info_only:
print("Deleting history id ", history.id)
@@ -174,13 +174,13 @@ def purge_histories(app, cutoff_time, remove_from_disk, info_only=False, force_r
if force_retry:
histories = app.sa_session.query(app.model.History) \
.filter(and_(app.model.History.table.c.deleted == true(),
app.model.History.table.c.update_time < cutoff_time)) \
app.model.History.table.c.update_time < cutoff_time)) \
.options(eagerload('datasets'))
else:
histories = app.sa_session.query(app.model.History) \
.filter(and_(app.model.History.table.c.deleted == true(),
app.model.History.table.c.purged == false(),
app.model.History.table.c.update_time < cutoff_time)) \
app.model.History.table.c.purged == false(),
app.model.History.table.c.update_time < cutoff_time)) \
.options(eagerload('datasets'))
for history in histories:
print("### Processing history id %d (%s)" % (history.id, unicodify(history.name)))
@@ -216,12 +216,12 @@ def purge_libraries(app, cutoff_time, remove_from_disk, info_only=False, force_r
if force_retry:
libraries = app.sa_session.query(app.model.Library) \
.filter(and_(app.model.Library.table.c.deleted == true(),
app.model.Library.table.c.update_time < cutoff_time))
app.model.Library.table.c.update_time < cutoff_time))
else:
libraries = app.sa_session.query(app.model.Library) \
.filter(and_(app.model.Library.table.c.deleted == true(),
app.model.Library.table.c.purged == false(),
app.model.Library.table.c.update_time < cutoff_time))
app.model.Library.table.c.purged == false(),
app.model.Library.table.c.update_time < cutoff_time))
for library in libraries:
_purge_folder(library.root_folder, app, remove_from_disk, info_only=info_only)
if not info_only:
@@ -247,12 +247,12 @@ def purge_folders(app, cutoff_time, remove_from_disk, info_only=False, force_ret
if force_retry:
folders = app.sa_session.query(app.model.LibraryFolder) \
.filter(and_(app.model.LibraryFolder.table.c.deleted == true(),
app.model.LibraryFolder.table.c.update_time < cutoff_time))
app.model.LibraryFolder.table.c.update_time < cutoff_time))
else:
folders = app.sa_session.query(app.model.LibraryFolder) \
.filter(and_(app.model.LibraryFolder.table.c.deleted == true(),
app.model.LibraryFolder.table.c.purged == false(),
app.model.LibraryFolder.table.c.update_time < cutoff_time))
app.model.LibraryFolder.table.c.purged == false(),
app.model.LibraryFolder.table.c.update_time < cutoff_time))
for folder in folders:
_purge_folder(folder, app, remove_from_disk, info_only=info_only)
folder_count += 1
@@ -267,29 +267,29 @@ def delete_datasets(app, cutoff_time, remove_from_disk, info_only=False, force_r
start = time.time()
if force_retry:
history_dataset_ids_query = sa.select((app.model.Dataset.table.c.id,
app.model.Dataset.table.c.state),
whereclause=app.model.HistoryDatasetAssociation.table.c.update_time < cutoff_time,
from_obj=[sa.outerjoin(app.model.Dataset.table,
app.model.HistoryDatasetAssociation.table)])
app.model.Dataset.table.c.state),
whereclause=app.model.HistoryDatasetAssociation.table.c.update_time < cutoff_time,
from_obj=[sa.outerjoin(app.model.Dataset.table,
app.model.HistoryDatasetAssociation.table)])
library_dataset_ids_query = sa.select((app.model.LibraryDataset.table.c.id,
app.model.LibraryDataset.table.c.deleted),
whereclause=app.model.LibraryDataset.table.c.update_time < cutoff_time,
from_obj=[app.model.LibraryDataset.table])
app.model.LibraryDataset.table.c.deleted),
whereclause=app.model.LibraryDataset.table.c.update_time < cutoff_time,
from_obj=[app.model.LibraryDataset.table])
else:
# We really only need the id column here, but sqlalchemy barfs when trying to select only 1 column
history_dataset_ids_query = sa.select((app.model.Dataset.table.c.id,
app.model.Dataset.table.c.state),
whereclause=and_(app.model.Dataset.table.c.deleted == false(),
app.model.HistoryDatasetAssociation.table.c.update_time < cutoff_time,
app.model.HistoryDatasetAssociation.table.c.deleted == true()),
from_obj=[sa.outerjoin(app.model.Dataset.table,
app.model.HistoryDatasetAssociation.table)])
app.model.Dataset.table.c.state),
whereclause=and_(app.model.Dataset.table.c.deleted == false(),
app.model.HistoryDatasetAssociation.table.c.update_time < cutoff_time,
app.model.HistoryDatasetAssociation.table.c.deleted == true()),
from_obj=[sa.outerjoin(app.model.Dataset.table,
app.model.HistoryDatasetAssociation.table)])
library_dataset_ids_query = sa.select((app.model.LibraryDataset.table.c.id,
app.model.LibraryDataset.table.c.deleted),
whereclause=and_(app.model.LibraryDataset.table.c.deleted == true(),
app.model.LibraryDataset.table.c.purged == false(),
app.model.LibraryDataset.table.c.update_time < cutoff_time),
from_obj=[app.model.LibraryDataset.table])
app.model.LibraryDataset.table.c.deleted),
whereclause=and_(app.model.LibraryDataset.table.c.deleted == true(),
app.model.LibraryDataset.table.c.purged == false(),
app.model.LibraryDataset.table.c.update_time < cutoff_time),
from_obj=[app.model.LibraryDataset.table])
deleted_dataset_count = 0
deleted_instance_count = 0
skip = []
@@ -357,14 +357,14 @@ def purge_datasets(app, cutoff_time, remove_from_disk, info_only=False, force_re
if force_retry:
datasets = app.sa_session.query(app.model.Dataset) \
.filter(and_(app.model.Dataset.table.c.deleted == true(),
app.model.Dataset.table.c.purgable == true(),
app.model.Dataset.table.c.update_time < cutoff_time))
app.model.Dataset.table.c.purgable == true(),
app.model.Dataset.table.c.update_time < cutoff_time))
else:
datasets = app.sa_session.query(app.model.Dataset) \
.filter(and_(app.model.Dataset.table.c.deleted == true(),
app.model.Dataset.table.c.purgable == true(),
app.model.Dataset.table.c.purged == false(),
app.model.Dataset.table.c.update_time < cutoff_time))
app.model.Dataset.table.c.purgable == true(),
app.model.Dataset.table.c.purged == false(),
app.model.Dataset.table.c.update_time < cutoff_time))
for dataset in datasets:
file_size = dataset.file_size
_purge_dataset(app, dataset, remove_from_disk, info_only=info_only)
+3 -3
View File
@@ -100,9 +100,9 @@ def get_sa_session(ini_file):
if not db_con:
db_con = "sqlite:///%s?isolation_level=IMMEDIATE" % ini_config.database
model = galaxy.model.mapping.init(ini_config.file_path,
db_con,
engine_options={},
create_tables=False)
db_con,
engine_options={},
create_tables=False)
return model.context.current, ini_config
+4 -4
View File
@@ -44,10 +44,10 @@ def build_index(sa_session, whoosh_index_dir):
lddas_indexed = 0
for id, name, info, dbkey, message in get_lddas(sa_session):
writer.add_document(id=id,
name=to_unicode(name),
info=to_unicode(info),
dbkey=to_unicode(dbkey),
message=to_unicode(message))
name=to_unicode(name),
info=to_unicode(info),
dbkey=to_unicode(dbkey),
message=to_unicode(message))
lddas_indexed += 1
writer.commit()
print("Number of active library datasets indexed: ", lddas_indexed)
+1 -1
View File
@@ -16,7 +16,7 @@ import sys
import drmaa
DRMAA_jobTemplate_attributes = ['args', 'remoteCommand', 'outputPath', 'errorPath', 'nativeSpecification',
'workingDirectory', 'jobName', 'email', 'project']
'workingDirectory', 'jobName', 'email', 'project']
def load_job_template_from_file(jt, filename):
+1 -1
View File
@@ -89,7 +89,7 @@ def main():
newelements.append("<tags/>\n ")
contents = (contents[0:addelementsatposition] + newelements +
contents[addelementsatposition:])
contents[addelementsatposition:])
# add .new for testing/safety purposes :P
newtoolconffile = open(toolconffile, 'w')
+2 -2
View File
@@ -33,8 +33,8 @@ except:
options.config = os.path.abspath(options.config)
config = ConfigParser(dict(file_path='database/files',
id_secret='USING THE DEFAULT IS NOT SECURE!',
database_connection='sqlite:///database/universe.sqlite?isolation_level=IMMEDIATE'))
id_secret='USING THE DEFAULT IS NOT SECURE!',
database_connection='sqlite:///database/universe.sqlite?isolation_level=IMMEDIATE'))
config.read(options.config)
helper = security.SecurityHelper(id_secret=config.get('app:main', 'id_secret'))
+101 -101
View File
@@ -39,107 +39,107 @@ VARIANTS = 'chrM,chr21,full,canon,female,male,haps,nohaps'
VARIANT_EXCLUSIONS = ':full'
DBKEY_DESCRIPTION_MAP = {'AaegL1': 'Mosquito (Aedes aegypti): AaegL1',
'AgamP3': 'Mosquito (Anopheles gambiae): AgamP3',
'anoCar1': 'Lizard (Anolis carolinensis): anoCar1',
'anoGam1': 'Mosquito (Anopheles gambiae): anoGam1',
'apiMel1': 'Honeybee (Apis mellifera): apiMel1',
'apiMel2': 'Honeybee (Apis mellifera): apiMel2',
'apiMel3': 'Honeybee (Apis mellifera): apiMel3',
'Arabidopsis_thaliana_TAIR9': '',
'borEut13': 'Boreoeutherian: borEut13',
'bosTau2': 'Cow (Bos taurus): bosTau2',
'bosTau3': 'Cow (Bos taurus): bosTau3',
'bosTau4': 'Cow (Bos taurus): bosTau4',
'bosTauMd3': 'Cow (Bos taurus): bosTauMd3',
'calJac1': 'Marmoset (Callithrix jacchus): calJac1',
'canFam1': 'Dog (Canis lupus familiaris): canFam1',
'canFam2': 'Dog (Canis lupus familiaris): canFam2',
'cavPor3': 'Guinea Pig (Cavia porcellus): cavPor3',
'ce2': 'Caenorhabditis elegans: ce2',
'ce4': 'Caenorhabditis elegans: ce4',
'ce5': 'Caenorhabditis elegans: ce5',
'ce6': 'Caenorhabditis elegans: ce6',
'CpipJ1': 'Mosquito (Culex quinquefasciatus): CpipJ1',
'danRer2': 'Zebrafish (Danio rerio): danRer2',
'danRer3': 'Zebrafish (Danio rerio): danRer3',
'danRer4': 'Zebrafish (Danio rerio): danRer4',
'danRer5': 'Zebrafish (Danio rerio): danRer5',
'danRer6': 'Zebrafish (Danio rerio): danRer6',
'dm1': 'Fruit Fly (Drosophila melanogaster): dm1',
'dm2': 'Fruit Fly (Drosophila melanogaster): dm2',
'dm3': 'Fruit Fly (Drosophila melanogaster): dm3',
'dm4': 'Fruit Fly (Drosophila melanogaster): dm',
'dp3': 'Fruit Fly (Drosophila pseudoobscura): dp3',
'dp4': 'Fruit Fly (Drosophila pseudoobscura): dp4',
'droAna1': 'Fruit Fly (Drosophila ananassae): droAna1',
'droAna2': 'Fruit Fly (Drosophila ananassae): droAna2',
'droAna3': 'Fruit Fly (Drosophila ananassae): droAna3',
'droEre1': 'Fruit Fly (Drosophila erecta): droEre1',
'droEre2': 'Fruit Fly (Drosophila erecta): droEre2',
'droGri1': 'Fruit Fly (Drosophila grimshawi): droGri1',
'droGri2': 'Fruit Fly (Drosophila grimshawi): droGri2',
'droMoj1': 'Fruit Fly (Drosophila mojavensis): droMoj1',
'droMoj2': 'Fruit Fly (Drosophila mojavensis): droMoj2',
'droMoj3': 'Fruit Fly (Drosophila mojavensis): droMoj3',
'droPer1': 'Fruit Fly (Drosophila persimilis): droPer1',
'droSec1': 'Fruit Fly (Drosophila sechellia): droSec1',
'droSim1': 'Fruit Fly (Drosophila simulans): droSim1',
'droVir1': 'Fruit Fly (Drosophila virilis): droVir1',
'droVir2': 'Fruit Fly (Drosophila virilis): droVir2',
'droVir3': 'Fruit Fly (Drosophila virilis): droVir3',
'droYak1': 'Fruit Fly (Drosophila yakuba): droYak1',
'droYak2': 'Fruit Fly (Drosophila yakuba): droYak2',
'echTel1': 'Tenrec (Echinops telfairi): echTel1',
'equCab1': 'Horse (Equus caballus): equCab1',
'equCab2': 'Horse (Equus caballus): equCab2',
'eriEur1': 'Hedgehog (Erinaceus europaeus): eriEur1',
'felCat3': 'Cat (Felis catus): felCat3',
'fr1': 'Fugu (Takifugu rubripes): fr1',
'fr2': 'Fugu (Takifugu rubripes): fr2',
'galGal2': 'Chicken (Gallus gallus): galGal2',
'galGal3': 'Chicken (Gallus gallus): galGal3',
'gasAcu1': 'Stickleback (Gasterosteus aculeatus): gasAcu1',
'hg16': 'Human (Homo sapiens): hg16',
'hg17': 'Human (Homo sapiens): hg17',
'hg18': 'Human (Homo sapiens): hg18',
'hg19': 'Human (Homo sapiens): hg19',
'IscaW1': 'Deer Tick (Ixodes scapularis): IscaW1',
'lMaj5': 'Leishmania major: lMaj5',
'mm5': 'Mouse (Mus musculus): mm5',
'mm6': 'Mouse (Mus musculus): mm6',
'mm7': 'Mouse (Mus musculus): mm7',
'mm8': 'Mouse (Mus musculus): mm8',
'mm9': 'Mouse (Mus musculus): mm9',
'monDom4': 'Opossum (Monodelphis domestica): monDom4',
'monDom5': 'Opossum (Monodelphis domestica): monDom5',
'ornAna1': 'Platypus (Ornithorhynchus anatinus): ornAna1',
'oryCun1': 'Rabbit (Oryctolagus cuniculus): oryCun1',
'oryLat1': 'Medaka (Oryzias latipes): oryLat1',
'oryLat2': 'Medaka (Oryzias latipes): oryLat2',
'oryza_sativa_japonica_nipponbare_IRGSP4.0': 'Rice (Oryza sativa L. ssp. japonica var. Nipponbare): IRGSP4.0',
'otoGar1': 'Bushbaby (Otolemur garnetti): otoGar1',
'panTro1': 'Chimpanzee (Pan troglodytes): panTro1',
'panTro2': 'Chimpanzee (Pan troglodytes): panTro2',
'petMar1': 'Lamprey (Petromyzon marinus): petMar1',
'phiX': 'phiX174 (AF176034)',
'PhumU1': 'Head Louse (Pediculus humanus): PhumU1',
'ponAbe2': 'Orangutan (Pongo pygmaeus abelii): ponAbe2',
'pUC18': 'pUC18 (L09136)',
'rheMac2': 'Rhesus Macaque (Macaca mulatta): rheMac2',
'rn3': 'Rat (Rattus norvegicus): rn3',
'rn4': 'Rat (Rattus norvegicus): rn4',
'sacCer1': 'Yeast (Saccharomyces cerevisiae): sacCer1',
'sacCer2': 'Yeast (Saccharomyces cerevisiae): sacCer2',
'sorAra1': 'Common Shrew (Sorex araneus): sorAra1',
'Sscrofa9.58': 'Pig (Sus scrofa): Sscrofa9.58',
'strPur2': 'Purple Sea Urchin (Strongylocentrotus purpuratus): strPur2',
'susScr2': 'Pig (Sus scrofa): susScr2',
'taeGut1': 'Zebra Finch (Taeniopygia guttata): taeGut1',
'tetNig1': 'Tetraodon (Tetraodon nigroviridis): tetNig1',
'tetNig2': 'Tetraodon (Tetraodon nigroviridis): tetNig2',
'tupBel1': 'Tree Shrew (Tupaia belangeri): tupBel1',
'venter1': 'Human (J. Craig Venter): venter1',
'xenTro2': 'Frog (Xenopus tropicalis): xenTro2'}
'AgamP3': 'Mosquito (Anopheles gambiae): AgamP3',
'anoCar1': 'Lizard (Anolis carolinensis): anoCar1',
'anoGam1': 'Mosquito (Anopheles gambiae): anoGam1',
'apiMel1': 'Honeybee (Apis mellifera): apiMel1',
'apiMel2': 'Honeybee (Apis mellifera): apiMel2',
'apiMel3': 'Honeybee (Apis mellifera): apiMel3',
'Arabidopsis_thaliana_TAIR9': '',
'borEut13': 'Boreoeutherian: borEut13',
'bosTau2': 'Cow (Bos taurus): bosTau2',
'bosTau3': 'Cow (Bos taurus): bosTau3',
'bosTau4': 'Cow (Bos taurus): bosTau4',
'bosTauMd3': 'Cow (Bos taurus): bosTauMd3',
'calJac1': 'Marmoset (Callithrix jacchus): calJac1',
'canFam1': 'Dog (Canis lupus familiaris): canFam1',
'canFam2': 'Dog (Canis lupus familiaris): canFam2',
'cavPor3': 'Guinea Pig (Cavia porcellus): cavPor3',
'ce2': 'Caenorhabditis elegans: ce2',
'ce4': 'Caenorhabditis elegans: ce4',
'ce5': 'Caenorhabditis elegans: ce5',
'ce6': 'Caenorhabditis elegans: ce6',
'CpipJ1': 'Mosquito (Culex quinquefasciatus): CpipJ1',
'danRer2': 'Zebrafish (Danio rerio): danRer2',
'danRer3': 'Zebrafish (Danio rerio): danRer3',
'danRer4': 'Zebrafish (Danio rerio): danRer4',
'danRer5': 'Zebrafish (Danio rerio): danRer5',
'danRer6': 'Zebrafish (Danio rerio): danRer6',
'dm1': 'Fruit Fly (Drosophila melanogaster): dm1',
'dm2': 'Fruit Fly (Drosophila melanogaster): dm2',
'dm3': 'Fruit Fly (Drosophila melanogaster): dm3',
'dm4': 'Fruit Fly (Drosophila melanogaster): dm',
'dp3': 'Fruit Fly (Drosophila pseudoobscura): dp3',
'dp4': 'Fruit Fly (Drosophila pseudoobscura): dp4',
'droAna1': 'Fruit Fly (Drosophila ananassae): droAna1',
'droAna2': 'Fruit Fly (Drosophila ananassae): droAna2',
'droAna3': 'Fruit Fly (Drosophila ananassae): droAna3',
'droEre1': 'Fruit Fly (Drosophila erecta): droEre1',
'droEre2': 'Fruit Fly (Drosophila erecta): droEre2',
'droGri1': 'Fruit Fly (Drosophila grimshawi): droGri1',
'droGri2': 'Fruit Fly (Drosophila grimshawi): droGri2',
'droMoj1': 'Fruit Fly (Drosophila mojavensis): droMoj1',
'droMoj2': 'Fruit Fly (Drosophila mojavensis): droMoj2',
'droMoj3': 'Fruit Fly (Drosophila mojavensis): droMoj3',
'droPer1': 'Fruit Fly (Drosophila persimilis): droPer1',
'droSec1': 'Fruit Fly (Drosophila sechellia): droSec1',
'droSim1': 'Fruit Fly (Drosophila simulans): droSim1',
'droVir1': 'Fruit Fly (Drosophila virilis): droVir1',
'droVir2': 'Fruit Fly (Drosophila virilis): droVir2',
'droVir3': 'Fruit Fly (Drosophila virilis): droVir3',
'droYak1': 'Fruit Fly (Drosophila yakuba): droYak1',
'droYak2': 'Fruit Fly (Drosophila yakuba): droYak2',
'echTel1': 'Tenrec (Echinops telfairi): echTel1',
'equCab1': 'Horse (Equus caballus): equCab1',
'equCab2': 'Horse (Equus caballus): equCab2',
'eriEur1': 'Hedgehog (Erinaceus europaeus): eriEur1',
'felCat3': 'Cat (Felis catus): felCat3',
'fr1': 'Fugu (Takifugu rubripes): fr1',
'fr2': 'Fugu (Takifugu rubripes): fr2',
'galGal2': 'Chicken (Gallus gallus): galGal2',
'galGal3': 'Chicken (Gallus gallus): galGal3',
'gasAcu1': 'Stickleback (Gasterosteus aculeatus): gasAcu1',
'hg16': 'Human (Homo sapiens): hg16',
'hg17': 'Human (Homo sapiens): hg17',
'hg18': 'Human (Homo sapiens): hg18',
'hg19': 'Human (Homo sapiens): hg19',
'IscaW1': 'Deer Tick (Ixodes scapularis): IscaW1',
'lMaj5': 'Leishmania major: lMaj5',
'mm5': 'Mouse (Mus musculus): mm5',
'mm6': 'Mouse (Mus musculus): mm6',
'mm7': 'Mouse (Mus musculus): mm7',
'mm8': 'Mouse (Mus musculus): mm8',
'mm9': 'Mouse (Mus musculus): mm9',
'monDom4': 'Opossum (Monodelphis domestica): monDom4',
'monDom5': 'Opossum (Monodelphis domestica): monDom5',
'ornAna1': 'Platypus (Ornithorhynchus anatinus): ornAna1',
'oryCun1': 'Rabbit (Oryctolagus cuniculus): oryCun1',
'oryLat1': 'Medaka (Oryzias latipes): oryLat1',
'oryLat2': 'Medaka (Oryzias latipes): oryLat2',
'oryza_sativa_japonica_nipponbare_IRGSP4.0': 'Rice (Oryza sativa L. ssp. japonica var. Nipponbare): IRGSP4.0',
'otoGar1': 'Bushbaby (Otolemur garnetti): otoGar1',
'panTro1': 'Chimpanzee (Pan troglodytes): panTro1',
'panTro2': 'Chimpanzee (Pan troglodytes): panTro2',
'petMar1': 'Lamprey (Petromyzon marinus): petMar1',
'phiX': 'phiX174 (AF176034)',
'PhumU1': 'Head Louse (Pediculus humanus): PhumU1',
'ponAbe2': 'Orangutan (Pongo pygmaeus abelii): ponAbe2',
'pUC18': 'pUC18 (L09136)',
'rheMac2': 'Rhesus Macaque (Macaca mulatta): rheMac2',
'rn3': 'Rat (Rattus norvegicus): rn3',
'rn4': 'Rat (Rattus norvegicus): rn4',
'sacCer1': 'Yeast (Saccharomyces cerevisiae): sacCer1',
'sacCer2': 'Yeast (Saccharomyces cerevisiae): sacCer2',
'sorAra1': 'Common Shrew (Sorex araneus): sorAra1',
'Sscrofa9.58': 'Pig (Sus scrofa): Sscrofa9.58',
'strPur2': 'Purple Sea Urchin (Strongylocentrotus purpuratus): strPur2',
'susScr2': 'Pig (Sus scrofa): susScr2',
'taeGut1': 'Zebra Finch (Taeniopygia guttata): taeGut1',
'tetNig1': 'Tetraodon (Tetraodon nigroviridis): tetNig1',
'tetNig2': 'Tetraodon (Tetraodon nigroviridis): tetNig2',
'tupBel1': 'Tree Shrew (Tupaia belangeri): tupBel1',
'venter1': 'Human (J. Craig Venter): venter1',
'xenTro2': 'Frog (Xenopus tropicalis): xenTro2'}
VARIANT_MAP = {'canon': 'Canonical',
'full': 'Full',
+41 -41
View File
@@ -404,10 +404,10 @@ class Tag(PageElement):
"""Represents a found HTML tag with its attributes and contents."""
XML_ENTITIES_TO_CHARS = {'apos': "'",
"quot": '"',
"amp": "&",
"lt": "<",
"gt": ">"
"quot": '"',
"amp": "&",
"lt": "<",
"gt": ">"
}
# An RE for finding ampersands that aren't the start of of a
# numeric entity.
@@ -1341,11 +1341,11 @@ class BeautifulSoup(BeautifulStoneSoup):
# Lists can contain other lists, but there are restrictions.
NESTABLE_LIST_TAGS = {'ol': [],
'ul': [],
'li': ['ul', 'ol'],
'dl': [],
'dd': ['dl'],
'dt': ['dl']}
'ul': [],
'li': ['ul', 'ol'],
'dl': [],
'dd': ['dl'],
'dt': ['dl']}
# Tables can contain other tables, but there are restrictions.
NESTABLE_TABLE_TAGS = {'table': [],
@@ -1564,7 +1564,7 @@ class UnicodeDammit:
# values that aren't in Python's aliases and can't be determined
# by the heuristics in find_codec.
CHARSET_ALIASES = {"macintosh": "mac-roman",
"x-sjis": "shift-jis"}
"x-sjis": "shift-jis"}
def __init__(self, markup, overrideEncodings=[],
smartQuotesTo='xml'):
@@ -1767,37 +1767,37 @@ class UnicodeDammit:
return s.translate(c.EBCDIC_TO_ASCII_MAP)
MS_CHARS = {'\x80': ('euro', '20AC'),
'\x81': ' ',
'\x82': ('sbquo', '201A'),
'\x83': ('fnof', '192'),
'\x84': ('bdquo', '201E'),
'\x85': ('hellip', '2026'),
'\x86': ('dagger', '2020'),
'\x87': ('Dagger', '2021'),
'\x88': ('circ', '2C6'),
'\x89': ('permil', '2030'),
'\x8A': ('Scaron', '160'),
'\x8B': ('lsaquo', '2039'),
'\x8C': ('OElig', '152'),
'\x8D': '?',
'\x8E': ('#x17D', '17D'),
'\x8F': '?',
'\x90': '?',
'\x91': ('lsquo', '2018'),
'\x92': ('rsquo', '2019'),
'\x93': ('ldquo', '201C'),
'\x94': ('rdquo', '201D'),
'\x95': ('bull', '2022'),
'\x96': ('ndash', '2013'),
'\x97': ('mdash', '2014'),
'\x98': ('tilde', '2DC'),
'\x99': ('trade', '2122'),
'\x9a': ('scaron', '161'),
'\x9b': ('rsaquo', '203A'),
'\x9c': ('oelig', '153'),
'\x9d': '?',
'\x9e': ('#x17E', '17E'),
'\x9f': ('Yuml', '178')}
'\x81': ' ',
'\x82': ('sbquo', '201A'),
'\x83': ('fnof', '192'),
'\x84': ('bdquo', '201E'),
'\x85': ('hellip', '2026'),
'\x86': ('dagger', '2020'),
'\x87': ('Dagger', '2021'),
'\x88': ('circ', '2C6'),
'\x89': ('permil', '2030'),
'\x8A': ('Scaron', '160'),
'\x8B': ('lsaquo', '2039'),
'\x8C': ('OElig', '152'),
'\x8D': '?',
'\x8E': ('#x17D', '17D'),
'\x8F': '?',
'\x90': '?',
'\x91': ('lsquo', '2018'),
'\x92': ('rsquo', '2019'),
'\x93': ('ldquo', '201C'),
'\x94': ('rdquo', '201D'),
'\x95': ('bull', '2022'),
'\x96': ('ndash', '2013'),
'\x97': ('mdash', '2014'),
'\x98': ('tilde', '2DC'),
'\x99': ('trade', '2122'),
'\x9a': ('scaron', '161'),
'\x9b': ('rsaquo', '203A'),
'\x9c': ('oelig', '153'),
'\x9d': '?',
'\x9e': ('#x17E', '17E'),
'\x9f': ('Yuml', '178')}
#######################################################################
+8 -8
View File
@@ -43,14 +43,14 @@ def main():
jobs = {}
try:
for job in app.model.Job.filter(sa.and_(app.model.Job.table.c.create_time.between('2008-05-23', '2008-11-29'),
app.model.Job.table.c.state == 'ok',
sa.or_(sa.and_(sa.or_(app.model.Job.table.c.tool_id == 'gops_intersect_1',
app.model.Job.table.c.tool_id == 'gops_subtract_1',
app.model.Job.table.c.tool_id == 'gops_coverage_1'),
sa.not_(app.model.Job.table.c.command_line.like('%-2 1,2,3%'))),
sa.and_(sa.or_(app.model.Job.table.c.tool_id == 'gops_complement_1',
app.model.Job.table.c.tool_id == 'gops_merge_1'),
sa.not_(app.model.Job.table.c.command_line.like('%-1 1,2,3%')))))).all():
app.model.Job.table.c.state == 'ok',
sa.or_(sa.and_(sa.or_(app.model.Job.table.c.tool_id == 'gops_intersect_1',
app.model.Job.table.c.tool_id == 'gops_subtract_1',
app.model.Job.table.c.tool_id == 'gops_coverage_1'),
sa.not_(app.model.Job.table.c.command_line.like('%-2 1,2,3%'))),
sa.and_(sa.or_(app.model.Job.table.c.tool_id == 'gops_complement_1',
app.model.Job.table.c.tool_id == 'gops_merge_1'),
sa.not_(app.model.Job.table.c.command_line.like('%-1 1,2,3%')))))).all():
print "# processing job id %s" % str(job.id)
for jtoda in job.output_datasets:
print "# --> processing JobToOutputDatasetAssociation id %s" % str(jtoda.id)
+3 -3
View File
@@ -42,9 +42,9 @@ def main():
jobs = {}
try:
for job in app.model.Job.filter(sa.and_(app.model.Job.table.c.create_time < '2008-12-16',
app.model.Job.table.c.state == 'ok',
app.model.Job.table.c.tool_id == 'gops_join_1',
sa.not_(app.model.Job.table.c.command_line.like('%-m 1 %')))).all():
app.model.Job.table.c.state == 'ok',
app.model.Job.table.c.tool_id == 'gops_join_1',
sa.not_(app.model.Job.table.c.command_line.like('%-m 1 %')))).all():
print "# processing job id %s" % str(job.id)
for jtoda in job.output_datasets:
print "# --> processing JobToOutputDatasetAssociation id %s" % str(jtoda.id)
+1 -1
View File
@@ -21,7 +21,7 @@ def init():
options.config = os.path.abspath(options.config)
config_parser = ConfigParser(dict(here=os.getcwd(),
database_connection='sqlite:///database/universe.sqlite?isolation_level=IMMEDIATE'))
database_connection='sqlite:///database/universe.sqlite?isolation_level=IMMEDIATE'))
config_parser.read(options.config)
config_dict = {}
+1 -1
View File
@@ -30,7 +30,7 @@ def init():
options.email = None
config_parser = ConfigParser(dict(here=os.getcwd(),
database_connection='sqlite:///database/universe.sqlite?isolation_level=IMMEDIATE'))
database_connection='sqlite:///database/universe.sqlite?isolation_level=IMMEDIATE'))
config_parser.read(options.config)
config_dict = {}
+4 -4
View File
@@ -26,10 +26,10 @@ class HTTPRedirectWithDataHandler(urllib2.HTTPRedirectHandler):
if str(code) in self.redirect_codes and request_method in self.valid_methods:
new_url = new_url.replace(' ', '%20')
request = urllib2.Request(new_url,
data=request.data,
headers=request.headers,
origin_req_host=request.get_origin_req_host(),
unverifiable=True)
data=request.data,
headers=request.headers,
origin_req_host=request.get_origin_req_host(),
unverifiable=True)
if self.method in self.valid_methods:
if request.get_method() != self.method:
request.get_method = lambda: self.method
+1 -1
View File
@@ -36,7 +36,7 @@ def main(options):
description = category_dict.get('description', None)
if name is not None and description is not None:
data = dict(name=name,
description=description)
description=description)
url = '%s/api/categories' % to_tool_shed
try:
response = submit(url, data, api_key)
+2 -2
View File
@@ -38,8 +38,8 @@ def main(options):
email = '%s@test.org' % username
password = 'testuser'
data = dict(email=email,
password=password,
username=username)
password=password,
username=username)
url = '%s/api/users' % to_tool_shed
try:
response = submit(url, data, api_key)
+15 -15
View File
@@ -24,21 +24,21 @@ CHUNK_SIZE = 2 ** 20 # 1Mb
def generate_repository_archive_filename(tool_shed_url, name, owner, changeset_revision, file_type,
export_repository_dependencies, use_tmp_archive_dir=False):
export_repository_dependencies, use_tmp_archive_dir=False):
tool_shed = remove_protocol_from_tool_shed_url(tool_shed_url)
file_type_str = basic_util.get_file_type_str(changeset_revision, file_type)
if export_repository_dependencies:
repositories_archive_filename = '%s_%s_%s_%s_%s' % (CAPSULE_WITH_DEPENDENCIES_FILENAME,
tool_shed,
name,
owner,
file_type_str)
tool_shed,
name,
owner,
file_type_str)
else:
repositories_archive_filename = '%s_%s_%s_%s_%s' % (CAPSULE_FILENAME,
tool_shed,
name,
owner,
file_type_str)
tool_shed,
name,
owner,
file_type_str)
if use_tmp_archive_dir:
tmp_archive_dir = tempfile.mkdtemp(prefix="tmp-toolshed-arcdir")
repositories_archive_filename = os.path.join(tmp_archive_dir, repositories_archive_filename)
@@ -89,12 +89,12 @@ def main(options):
export_repository_dependencies = string_as_bool(options.export_repository_dependencies)
repositories_archive_filename = \
generate_repository_archive_filename(base_tool_shed_url,
options.name,
options.owner,
options.changeset_revision,
file_type,
export_repository_dependencies=export_repository_dependencies,
use_tmp_archive_dir=False)
options.name,
options.owner,
options.changeset_revision,
file_type,
export_repository_dependencies=export_repository_dependencies,
use_tmp_archive_dir=False)
download_url = export_dict['download_url']
download_dir = os.path.abspath(options.download_dir)
file_path = os.path.join(download_dir, repositories_archive_filename)
@@ -44,13 +44,13 @@ def main(options):
tools_functionally_correct = str(options.tools_functionally_correct)
parts = ['repository_revisions']
params = dict(do_not_test=do_not_test,
downloadable=downloadable,
includes_tools=includes_tools,
malicious=malicious,
missing_test_components=missing_test_components,
skip_tool_test=skip_tool_test,
test_install_error=test_install_error,
tools_functionally_correct=tools_functionally_correct)
downloadable=downloadable,
includes_tools=includes_tools,
malicious=malicious,
missing_test_components=missing_test_components,
skip_tool_test=skip_tool_test,
test_install_error=test_install_error,
tools_functionally_correct=tools_functionally_correct)
api_url = get_api_url(base=base_tool_shed_url, parts=parts, params=params)
baseline_repository_dicts, error_message = json_from_url(api_url)
if baseline_repository_dicts is None or error_message:
@@ -84,7 +84,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Get a filtered list of repository dictionaries.')
parser.add_argument("-u", "--url", dest="tool_shed_url", required=True, help="Tool Shed URL")
parser.add_argument("-l", "--latest_revision_only", dest="latest_revision_only", default=True,
help="Restrict results to latest downloadable revision only")
help="Restrict results to latest downloadable revision only")
parser.add_argument("-n", "--do_not_test", help="do_not_test", default=False)
parser.add_argument("-d", "--downloadable", help="downloadable", default=True)
parser.add_argument("-i", "--includes_tools", help="includes_tools", default=True)
@@ -70,7 +70,7 @@ def main(options):
sys.exit(1)
else:
data = dict(encoded_ids_to_skip=encoded_ids_to_skip,
my_writable=my_writable)
my_writable=my_writable)
url = '%s/api/repositories/reset_metadata_on_repositories' % base_tool_shed_url
try:
submit(url, data, options.api)
@@ -35,9 +35,9 @@ class BootstrapApplication(object):
print 'Using database connection: ', self.config.database_connection
# Setup the database engine and ORM
self.model = mapping.init(self.config.file_path,
self.config.database_connection,
engine_options={},
create_tables=False)
self.config.database_connection,
engine_options={},
create_tables=False)
self.security = security.SecurityHelper(id_secret=self.config.id_secret)
self.hgweb_config_manager = self.model.hgweb_config_manager
self.hgweb_config_manager.hgweb_config_dir = self.config.hgweb_config_dir
+20 -20
View File
@@ -97,13 +97,13 @@ def build_index(sa_session, whoosh_index_dir, path_to_repositories):
for tool in repo.get('tools_list'):
# print tool
tool_index_writer.add_document(id=to_unicode(tool.get('id')),
name=to_unicode(tool.get('name')),
version=to_unicode(tool.get('version')),
description=to_unicode(tool.get('description')),
help=to_unicode(tool.get('help')),
repo_owner_username=to_unicode(repo.get('repo_owner_username')),
repo_name=to_unicode(repo.get('name')),
repo_id=repo.get('id'))
name=to_unicode(tool.get('name')),
version=to_unicode(tool.get('version')),
description=to_unicode(tool.get('description')),
help=to_unicode(tool.get('help')),
repo_owner_username=to_unicode(repo.get('repo_owner_username')),
repo_name=to_unicode(repo.get('name')),
repo_id=repo.get('id'))
tools_indexed += 1
print tools_indexed, 'tools (', tool.get('id'), ')'
@@ -164,17 +164,17 @@ def get_repos(sa_session, path_to_repositories):
tools_list.extend(tools_in_dir)
results.append(dict(id=repo_id,
name=name,
description=description,
long_description=long_description,
homepage_url=homepage_url,
remote_repository_url=remote_repository_url,
repo_owner_username=repo_owner_username,
times_downloaded=times_downloaded,
approved=approved,
last_updated=last_updated,
full_last_updated=full_last_updated,
tools_list=tools_list))
name=name,
description=description,
long_description=long_description,
homepage_url=homepage_url,
remote_repository_url=remote_repository_url,
repo_owner_username=repo_owner_username,
times_downloaded=times_downloaded,
approved=approved,
last_updated=last_updated,
full_last_updated=full_last_updated,
tools_list=tools_list))
return results
@@ -191,8 +191,8 @@ def load_one_dir(path):
if root.find('description') is not None:
tool.update(dict(description=root.find('description').text))
tool.update(dict(id=root.attrib.get('id'),
name=root.attrib.get('name'),
version=root.attrib.get('version')))
name=root.attrib.get('name'),
version=root.attrib.get('version')))
tools_in_dir.append(tool)
return tools_in_dir
@@ -55,16 +55,16 @@ if __name__ == '__main__':
description += 'the --delete command line argument is provided.'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('--delete',
dest='delete',
required=False,
action='store_true',
default=False,
help='Whether to delete empty folders or list them on exit.')
dest='delete',
required=False,
action='store_true',
default=False,
help='Whether to delete empty folders or list them on exit.')
parser.add_argument('--basepath',
dest='basepath',
required=True,
action='store',
metavar='name',
help='The base path where tool dependencies are installed.')
dest='basepath',
required=True,
action='store',
metavar='name',
help='The base path where tool dependencies are installed.')
args = parser.parse_args()
sys.exit(main(args))
@@ -116,38 +116,38 @@ if __name__ == '__main__':
description += 'the --delete command line argument is provided with a true value.'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('--delete',
dest='delete',
required=True,
action='store',
default=False,
type=asbool,
help='Whether to delete empty folders or list them on exit.')
dest='delete',
required=True,
action='store',
default=False,
type=asbool,
help='Whether to delete empty folders or list them on exit.')
parser.add_argument('--bucket',
dest='bucket',
required=True,
action='store',
metavar='name',
help='The S3 bucket where tool dependencies are installed.')
dest='bucket',
required=True,
action='store',
metavar='name',
help='The S3 bucket where tool dependencies are installed.')
parser.add_argument('--id',
dest='id',
required=False,
action='store',
default=None,
metavar='ACCESS_KEY',
help='The identifier for an amazon account that has read access to the bucket.')
dest='id',
required=False,
action='store',
default=None,
metavar='ACCESS_KEY',
help='The identifier for an amazon account that has read access to the bucket.')
parser.add_argument('--secret',
dest='secret',
required=False,
action='store',
default=None,
metavar='SECRET_KEY',
help='The secret key for an amazon account that has upload/delete access to the bucket.')
dest='secret',
required=False,
action='store',
default=None,
metavar='SECRET_KEY',
help='The secret key for an amazon account that has upload/delete access to the bucket.')
parser.add_argument('--s3passwd',
dest='s3passwd',
required=False,
action='store',
default=None,
metavar='path/file',
help='The path to a file containing Amazon access credentials, in the format KEY:SECRET.')
dest='s3passwd',
required=False,
action='store',
default=None,
metavar='path/file',
help='The path to a file containing Amazon access credentials, in the format KEY:SECRET.')
args = parser.parse_args()
sys.exit(main(args))
@@ -23,10 +23,10 @@ if __name__ == '__main__':
description = 'Clean out the configured tool dependency path, creating it if it does not exist.'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('--tool_dependency_dir',
dest='tool_dependency_dir',
required=True,
action='store',
metavar='name',
help='The base path where tool dependencies will be installed.')
dest='tool_dependency_dir',
required=True,
action='store',
metavar='name',
help='The base path where tool dependencies will be installed.')
args = parser.parse_args()
sys.exit(main(args))
@@ -105,18 +105,18 @@ def deprecate_repositories(app, cutoff_time, days=14, info_only=False, verbose=F
# Get a unique list of repository ids from the repository_metadata table. Any repository ID found in this table is not
# empty, and will not be checked.
metadata_records = sa.select([distinct(app.model.RepositoryMetadata.table.c.repository_id)],
from_obj=app.model.RepositoryMetadata.table) \
.execute()
from_obj=app.model.RepositoryMetadata.table) \
.execute()
for metadata_record in metadata_records:
repository_ids_to_not_check.append(metadata_record.repository_id)
# Get the repositories that are A) not present in the above list, and b) older than the specified time.
# This will yield a list of repositories that have been created more than n days ago, but never populated.
repository_query = sa.select([app.model.Repository.table.c.id],
whereclause=and_(app.model.Repository.table.c.create_time < cutoff_time,
app.model.Repository.table.c.deprecated == false(),
app.model.Repository.table.c.deleted == false(),
not_(app.model.Repository.table.c.id.in_(repository_ids_to_not_check))),
from_obj=[app.model.Repository.table])
whereclause=and_(app.model.Repository.table.c.create_time < cutoff_time,
app.model.Repository.table.c.deprecated == false(),
app.model.Repository.table.c.deleted == false(),
not_(app.model.Repository.table.c.id.in_(repository_ids_to_not_check))),
from_obj=[app.model.Repository.table])
query_result = repository_query.execute()
repositories = []
repositories_by_owner = {}
@@ -52,9 +52,9 @@ def directory_hash_id(id):
def get_versions(app, item):
"""Get all versions of item whose state is a valid state"""
valid_states = [app.model.Tool.states.NEW,
app.model.Tool.states.WAITING,
app.model.Tool.states.APPROVED,
app.model.Tool.states.ARCHIVED]
app.model.Tool.states.WAITING,
app.model.Tool.states.APPROVED,
app.model.Tool.states.ARCHIVED]
versions = [item]
this_item = item
while item.newer_version:
@@ -85,8 +85,8 @@ def create_repository_from_tool(app, sa_session, tool):
repo_name = tool.tool_id.lower().replace(' ', '_')
print "Creating repository '%s' in database" % (repo_name)
repository = app.model.Repository(name=repo_name,
description=tool.description,
user_id=tool.user_id)
description=tool.description,
user_id=tool.user_id)
# Flush to get the id
sa_session.add(repository)
sa_session.flush()
@@ -116,8 +116,8 @@ def create_repository_from_tool(app, sa_session, tool):
print "Associating ratings for tool '%s' with repository '%s'" % (tool.name, repository.name)
for tra in tool.ratings:
rra = app.model.RepositoryRatingAssociation(user=tra.user,
rating=tra.rating,
comment=tra.comment)
rating=tra.rating,
comment=tra.comment)
rra.repository = repository
sa_session.add(rra)
sa_session.flush()
@@ -54,17 +54,17 @@ if __name__ == '__main__':
description += '--delete command line argument is provided.'
parser = argparse.ArgumentParser(description=description)
parser.add_argument('--basepath',
dest='basepath',
required=True,
action='store',
metavar='name',
help='The base path where tool dependencies are installed.')
dest='basepath',
required=True,
action='store',
metavar='name',
help='The base path where tool dependencies are installed.')
parser.add_argument('--dburi',
dest='dburi',
required=True,
action='store',
metavar='dburi',
help='The database URI to connect to.')
dest='dburi',
required=True,
action='store',
metavar='dburi',
help='The database URI to connect to.')
args = parser.parse_args()
database_connection = args.dburi
config_dict = dict(database_connection=database_connection, tool_dependency_dir=args.basepath)
+9 -9
View File
@@ -52,7 +52,7 @@ class ArgHandler(object):
def __init__(self):
self.parser = optparse.OptionParser()
self.parser.add_option('-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)',
default=os.path.abspath(os.path.join(galaxy_root, 'config/galaxy.ini')))
default=os.path.abspath(os.path.join(galaxy_root, 'config/galaxy.ini')))
self.parser.add_option('-d', '--debug', action='store_true', dest='debug', help="Debug (don't detach)")
self.parser.add_option('-s', '--slow', action='store_true', dest='slow', help="Transfer slowly (for debugging)")
self.opts = None
@@ -83,9 +83,9 @@ class GalaxyApp(object):
"""
def __init__(self, config_file):
self.config = ConfigParser.ConfigParser(dict(database_file='database/universe.sqlite',
file_path='database/files',
transfer_worker_port_range='12275-12675',
transfer_worker_log=None))
file_path='database/files',
transfer_worker_port_range='12275-12675',
transfer_worker_log=None))
self.config.read(config_file)
self.model = bunch.Bunch()
self.connect_database()
@@ -275,12 +275,12 @@ def scp_transfer(transfer_job):
try:
# TODO: add the ability to determine progress of the copy here like we do in the http_transfer above.
cmd = "scp %s@%s:'%s' '%s'" % (user_name,
host,
file_path.replace(' ', '\ '),
fn)
host,
file_path.replace(' ', '\ '),
fn)
pexpect.run(cmd, events={'.ssword:*': password + '\r\n',
pexpect.TIMEOUT: print_ticks},
timeout=10)
pexpect.TIMEOUT: print_ticks},
timeout=10)
return dict(state=transfer_job.states.DONE, path=fn)
except Exception as e:
return dict(state=transfer_job.states.ERROR, info='Error during file transfer: %s' % str(e))