Skip to content

Commit

Permalink
ProTo: Small code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
morj-uio authored and sveinugu committed Dec 7, 2016
1 parent e150239 commit 5adef24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
13 changes: 2 additions & 11 deletions lib/proto/hyper_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,10 @@ def __init__(self, trans):
def encode_id(self, id):
from proto.config.Security import galaxySecureEncodeId
return galaxySecureEncodeId(id)
# return self.trans.security.encode_id(id)

def decode_id(self, id):
from proto.config.Security import galaxySecureDecodeId
return galaxySecureDecodeId(id)
# return self.trans.security.decode_id(id)

def getDataFilePath(self, id):
from proto.CommonFunctions import getGalaxyFnFromAnyDatasetId
Expand All @@ -104,18 +102,15 @@ def getHistory(self, exts = None, dbkey = None):
datasets.append(dataset)
return datasets


def optionsFromHistory(self, exts, sel=None, datasets=None):
html = ''

if not datasets:
#datasets = self.trans.get_history().active_datasets
datasets = self.getHistory(exts)

for dataset in datasets:
#if exts is None or dataset.extension in exts:
option = self.makeHistoryOption(dataset, sel)[0]
html += option
option = self.makeHistoryOption(dataset, sel)[0]
html += option
return html

def optionsFromHistoryFn(self, exts = None, tools = None, select = None):
Expand All @@ -125,8 +120,6 @@ def optionsFromHistoryFn(self, exts = None, tools = None, select = None):
if tools:
job = getJobFromDataset(dataset)
tool_id = job.tool_id if job else None
#if dataset.visible and dataset.state == 'ok':
# if exts == None or dataset.extension in exts or any([isinstance(dataset.datatype, ext) for ext in exts if isinstance(ext, type)]):
if tools is None or tool_id in tools:
option, val = self.makeHistoryOption(dataset, select)
vals.append(val)
Expand All @@ -136,7 +129,6 @@ def optionsFromHistoryFn(self, exts = None, tools = None, select = None):
def itemsFromHistoryFn(self, exts = None):
items = OrderedDict()
for dataset in self.getHistory(exts):
#if (exts == None or dataset.extension in exts) and dataset.state == 'ok':
option_tag, val = self.makeHistoryOption(dataset)
items[str(dataset.dataset_id)] = val
return items
Expand All @@ -147,7 +139,6 @@ def makeHistoryOption(self, dataset, select=None, sep=':'):
sel_id = self.getHistoryOptionId(select)

if sep == ',':
#vals = ['galaxy', self.encode_id(dataset.dataset_id), dataset.extension, self.makeHistoryOptionName(dataset)]
vals = ['galaxy', self.encode_id(dataset.dataset_id), dataset.extension]
else:
vals = ['galaxy', dataset.extension, self.encode_id(dataset.dataset_id), self.makeHistoryOptionName(dataset)]
Expand Down
1 change: 0 additions & 1 deletion templates/proto/generictool.mako
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# along with The Genomic HyperBrowser. If not, see <http://www.gnu.org/licenses/>.
import sys, os, traceback, json
import cPickle as pickle
from zlib import compress
from base64 import urlsafe_b64encode
from cgi import escape
Expand Down

0 comments on commit 5adef24

Please sign in to comment.