Merge pull request #6722 from nsoranzo/fix_warnings

Small mixed fixes
This commit is contained in:
John Chilton
2018-09-17 12:40:45 -04:00
committed by GitHub
26 changed files with 39 additions and 38 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ tc.agent("Mozilla/5.0 (compatible; check_galaxy/0.2)")
tc.config('use_tidy', 0)
class Browser:
class Browser(object):
def __init__(self):
self.server = server
self.handler = handler
+1 -1
View File
@@ -230,7 +230,7 @@ class Strategy(BaseStrategy):
return self.backend.continue_pipeline(*args, **kwargs)
class Storage:
class Storage(object):
user = UserAuthnzToken
nonce = PSANonce
association = PSAAssociation
+3 -3
View File
@@ -714,7 +714,7 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin):
def __watch_directory(self, directory, elems, integrated_elems, load_panel_dict, recursive, force_watch=False):
def quick_load(tool_file, async=True):
def quick_load(tool_file, async_load=True):
try:
tool = self.load_tool(tool_file)
self.__add_tool(tool, load_panel_dict, elems)
@@ -722,7 +722,7 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin):
key = 'tool_%s' % str(tool.id)
integrated_elems[key] = tool
if async:
if async_load:
self._load_tool_panel()
self._save_integrated_tool_panel()
return tool.id
@@ -739,7 +739,7 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin):
if os.path.isdir(child_path) and recursive:
self.__watch_directory(child_path, elems, integrated_elems, load_panel_dict, recursive)
elif self._looks_like_a_tool(child_path):
quick_load(child_path, async=False)
quick_load(child_path, async_load=False)
tool_loaded = True
if (tool_loaded or force_watch) and self._tool_watcher:
self._tool_watcher.watch_directory(directory, quick_load)
+1 -1
View File
@@ -731,7 +731,7 @@ def get_attributes_from_fasta_header(header):
def iter_fasta_alignment(filename):
class fastaComponent:
class fastaComponent(object):
def __init__(self, species, text=""):
self.species = species
self.text = text
+1 -1
View File
@@ -265,7 +265,7 @@ class GalaxyInteractorApi(object):
output_id = output_data
return output_id
def stage_data_async(self, test_data, history_id, tool_id, async=True):
def stage_data_async(self, test_data, history_id, tool_id):
fname = test_data['fname']
tool_input = {
"file_type": test_data['ftype'],
+2 -2
View File
@@ -120,7 +120,7 @@ class SelectToolParameterWrapper(ToolParameterValueWrapper):
attributes are accessible.
"""
class SelectToolParameterFieldWrapper:
class SelectToolParameterFieldWrapper(object):
"""
Provide access to any field by name or index for this particular value.
Only applicable for dynamic_options selects, which have more than simple 'options' defined (name, value, selected).
@@ -182,7 +182,7 @@ class DatasetFilenameWrapper(ToolParameterValueWrapper):
attributes are accessible.
"""
class MetadataWrapper:
class MetadataWrapper(object):
"""
Wraps a Metadata Collection to return MetadataParameters wrapped
according to the metadata spec. Methods implemented to match behavior
+1 -1
View File
@@ -33,7 +33,7 @@ class StreamBall(object):
def stream(self, environ, start_response):
response_write = start_response(self.wsgi_status, self.wsgi_headeritems)
class tarfileobj:
class tarfileobj(object):
def write(self, *args, **kwargs):
response_write(*args, **kwargs)
tf = tarfile.open(mode=self.mode, fileobj=tarfileobj())
+2 -2
View File
@@ -141,7 +141,7 @@ def _expand_macro(element, expand_el, macros, tokens):
# require this parent_map data structure but elementtree does not
# track parents or recongnize .find('..').
# TODO fix this now that we're not using elementtree
parent_map = dict((c, p) for p in element.getiterator() for c in p)
parent_map = dict((c, p) for p in element.iter() for c in p)
_xml_replace(expand_el, expanded_elements, parent_map)
@@ -150,7 +150,7 @@ def _expand_yield_statements(macro_def, expand_el):
expand_el_children = list(expand_el)
macro_def_parent_map = \
dict((c, p) for macro_def_el in macro_def for p in macro_def_el.getiterator() for c in p)
dict((c, p) for macro_def_el in macro_def for p in macro_def_el.iter() for c in p)
for yield_el in yield_els:
_xml_replace(yield_el, expand_el_children, macro_def_parent_map)
+1 -1
View File
@@ -369,7 +369,7 @@ class Request(webob.Request):
Create a new request wrapping the WSGI environment `environ`
"""
# self.environ = environ
webob.Request.__init__(self, environ, charset='utf-8', decode_param_names=False)
webob.Request.__init__(self, environ, charset='utf-8')
# Properties that are computed and cached on first use
@lazy_property
+1
View File
@@ -1,6 +1,7 @@
[pytest]
addopts = --doctest-continue-on-failure
log_level = DEBUG
python_classes =
python_paths = lib
markers =
data_manager: marks test as a data_manager test
+1 -1
View File
@@ -8,7 +8,7 @@ import sys
from bioblend import galaxy
class Uploader:
class Uploader(object):
def __init__(self, url, api, library_id, folder_id, should_link,
non_local):
+1 -1
View File
@@ -6,7 +6,7 @@ import time
from bioblend.galaxy import GalaxyInstance
class ApplyTagsHistory:
class ApplyTagsHistory(object):
@classmethod
def __init__(self, galaxy_url, galaxy_api_key, history_id=None):
+1 -1
View File
@@ -107,7 +107,7 @@ tc.agent("Mozilla/5.0 (compatible; check_galaxy/0.1)")
tc.config('use_tidy', 0)
class Browser:
class Browser(object):
def __init__(self):
self.server = server
+1 -1
View File
@@ -48,7 +48,7 @@ def kw_metrics(job):
}
class Sanitization:
class Sanitization(object):
def __init__(self, sanitization_config, model, sa_session):
self.sanitization_config = sanitization_config
+2 -2
View File
@@ -205,11 +205,11 @@ def __main__():
loc_path = None
tree = parse(options.data_table_xml)
tables = tree.getroot()
for table in tables.getiterator():
for table in tables.iter():
name = table.attrib.get('name')
if name == options.data_table_name:
cols = None
for node in table.getiterator():
for node in table.iter():
if node.tag == 'columns':
cols = node.text
elif node.tag == 'file':
+2 -2
View File
@@ -7,7 +7,7 @@ assert sys.version_info[:2] >= (2, 4)
# genbank_to_bed
class Region:
class Region(object):
def __init__(self):
self.qualifiers = {}
self.start = None
@@ -37,7 +37,7 @@ class Region:
self.end = end
class GenBankFeatureParser:
class GenBankFeatureParser(object):
"""Parses Features from Single Locus GenBank file"""
def __init__(self, fh, features_list=[]):
self.fh = fh
+1 -1
View File
@@ -19,7 +19,7 @@ from .interactor import TestCaseGalaxyInteractor as BaseInteractor
from .testcase import FunctionalTestCase
class UsesApiTestCaseMixin:
class UsesApiTestCaseMixin(object):
def _api_url(self, path, params=None, use_key=None, use_admin_key=None):
if not params:
+2 -2
View File
@@ -140,7 +140,7 @@ def _raise_skip_if(check):
# Deprecated mixin, use dataset populator instead.
# TODO: Rework existing tests to target DatasetPopulator in a setup method instead.
class TestsDatasets:
class TestsDatasets(object):
def _new_dataset(self, history_id, content='TestData123', **kwds):
return DatasetPopulator(self.galaxy_interactor).new_dataset(history_id, content=content, **kwds)
@@ -1087,7 +1087,7 @@ def wait_on_state(state_func, desc="state", skip_states=["running", "queued", "n
raise TimeoutAssertionError("%s Current response containing state [%s]." % (str(e), response.json()))
class GiPostGetMixin:
class GiPostGetMixin(object):
"""Mixin for adapting Galaxy testing populators helpers to bioblend."""
def _get(self, route, data={}):
+1 -1
View File
@@ -14,7 +14,7 @@ from selenium.webdriver.support.ui import WebDriverWait
UNSPECIFIED_TIMEOUT = object()
class HasDriver:
class HasDriver(object):
TimeoutException = TimeoutException
def assert_xpath(self, xpath):
+1 -1
View File
@@ -24,7 +24,7 @@ JobEnviromentProperties = collections.namedtuple("JobEnvironmentProperties", [
])
class RunsEnvironmentJobs:
class RunsEnvironmentJobs(object):
def _run_and_get_environment_properties(self, tool_id="job_environment_default"):
with self.dataset_populator.test_history() as history_id:
+2 -2
View File
@@ -431,7 +431,7 @@ class SharedStateSeleniumTestCase(SeleniumTestCase):
"""Override this to setup shared data for tests that gets initialized only once."""
class UsesHistoryItemAssertions:
class UsesHistoryItemAssertions(object):
def assert_item_peek_includes(self, hid, expected):
item_body = self.history_panel_item_component(hid=hid)
@@ -508,7 +508,7 @@ def get_remote_driver():
)
class SeleniumSessionGetPostMixin:
class SeleniumSessionGetPostMixin(object):
"""Mixin for adapting Galaxy testing populators helpers to Selenium session backed bioblend."""
def _get(self, route, data={}):
+3 -3
View File
@@ -194,7 +194,7 @@ class ToolEvaluatorTestCase(TestCase, UsesApp):
kwds["working_directory"] = self.test_directory
if "new_file_path" not in kwds:
kwds["new_file_path"] = self.app.config.new_file_path
self.evaluator.set_compute_environment(TestComputeEnviornment(**kwds))
self.evaluator.set_compute_environment(TestComputeEnvironment(**kwds))
assert "exec_before_job" in self.tool.hooks_called
def _setup_test_bwa_job(self):
@@ -218,7 +218,7 @@ class MockHistoryDatasetAssociation(HistoryDatasetAssociation):
super(MockHistoryDatasetAssociation, self).__init__(**kwds)
class TestComputeEnviornment(SimpleComputeEnvironment):
class TestComputeEnvironment(SimpleComputeEnvironment):
def __init__(
self,
@@ -256,7 +256,7 @@ class TestComputeEnviornment(SimpleComputeEnvironment):
if self._path_rewriter:
return self._path_rewriter
else:
return super(TestComputeEnviornment, self).unstructured_path_rewriter()
return super(TestComputeEnvironment, self).unstructured_path_rewriter()
def tool_directory(self):
return TEST_TOOL_DIRECTORY
+3 -3
View File
@@ -20,7 +20,7 @@ from galaxy.util import stringify_dictionary_keys
from galaxy.util.bunch import Bunch
class OffsetList:
class OffsetList(object):
def __init__(self, filesize=0, fmt=None):
self.file = tempfile.NamedTemporaryFile('w+b')
if fmt:
@@ -146,7 +146,7 @@ class SortedOffsets(OffsetList):
# indexed set of offsets, index is built on demand
class OffsetIndex:
class OffsetIndex(object):
def __init__(self, filename, column, split=None, index_depth=3):
self.filename = filename
self.file = open(filename, 'r')
@@ -239,7 +239,7 @@ class OffsetIndex:
first_char = identifier[0]
class BufferedIndex:
class BufferedIndex(object):
def __init__(self, filename, column, split=None, buffer=1000000, index_depth=3):
self.index = OffsetIndex(filename, column, split, index_depth)
self.buffered_offsets = {}
+1 -1
View File
@@ -1180,7 +1180,7 @@ def read_ssaha_data(ssahadata_fh):
#
##########################################################################
class Fasta:
class Fasta(object):
def __init__(self, name, sequence):
self.name = name
self.sequence = sequence
+2 -2
View File
@@ -37,7 +37,7 @@ debug_flag = False
@total_ordering
class node:
class node(object):
def __init__(self, name):
self.name = name
self.edges = []
@@ -65,7 +65,7 @@ class node:
return self.name
class graph:
class graph(object):
def __init__(self):
self.nodes = {}
+1 -1
View File
@@ -25,7 +25,7 @@ from bx.cookbook import doc_optparse
from galaxy.util.ucsc import UCSCLimitException, UCSCOutWrapper
class PositionalScoresOnDisk:
class PositionalScoresOnDisk(object):
fmt = 'f'
fmt_size = struct.calcsize(fmt)
default_value = float('nan')