本文整理汇总了Python中askomics.libaskomics.ParamManager.ParamManager.get_upload_directory方法的典型用法代码示例。如果您正苦于以下问题:Python ParamManager.get_upload_directory方法的具体用法?Python ParamManager.get_upload_directory怎么用?Python ParamManager.get_upload_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类askomics.libaskomics.ParamManager.ParamManager
的用法示例。
在下文中一共展示了ParamManager.get_upload_directory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_upload_directory
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import get_upload_directory [as 别名]
def test_get_upload_directory(self):
m = ParamManager(self.settings, self.request.session)
d = m.get_upload_directory()
assert os.path.isdir(d)
del self.request.session['username']
d = m.get_upload_directory()
assert os.path.isdir(d)
示例2: upload_file_into_history
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import get_upload_directory [as 别名]
def upload_file_into_history(self, filename):
"""Upload a file (present in user upload directory) into the testing history
:param filename: the file to upload
"""
param_manager = ParamManager(self.settings, self.request.session)
src_file = param_manager.get_upload_directory()
self.galaxy_instance.tools.upload_file(src_file + filename, self.history_id, file_name=filename)
示例3: test_send_to_history
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import get_upload_directory [as 别名]
def test_send_to_history(self):
"""Test the send_to_history method"""
galaxy_connector = GalaxyConnector(self.settings, self.request.session, self.galaxy['url'], self.galaxy['key'])
param_manager = ParamManager(self.settings, self.request.session)
src_file = param_manager.get_upload_directory()
filepath = src_file + 'play_instrument.tsv'
galaxy_connector.send_to_history(filepath, 'play_instrument.tsv', 'tabular')
assert self.interface_galaxy.check_dataset_presence('play_instrument.tsv') is True
示例4: __init__
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import get_upload_directory [as 别名]
def __init__(self, request):
self.log = logging.getLogger(__name__)
self.request = request
request.response.headers['Access-Control-Allow-Origin'] = '*'
request.response.headers['Access-Control-Allow-Methods'] = 'OPTIONS, HEAD, GET, POST, PUT, DELETE'
#self.dir_string = '__' + self.request.session['username'] + '__'
# Set the tmp dir
#if 'upload_directory' not in request.session.keys() or self.dir_string not in request.session['upload_directory'] or not os.path.isdir(request.session['upload_directory']):
# request.session['upload_directory'] = tempfile.mkdtemp(suffix='_tmp', prefix='__' + self.request.session['username'] + '__')
self.settings = request.registry.settings
pm = ParamManager(self.settings, self.request.session)
self.upload_dir = pm.get_upload_directory()
#self.upload_dir = request.session['upload_directory']
self.log.debug("upload_directory => "+self.upload_dir)
self.allowed_types = self.settings["askomics.allowed_file_types"]
self.delete_method = self.settings["askomics.delete_method"]
self.min_size = int(self.settings["askomics.upload_min_size"])
self.max_size = int(self.settings["askomics.upload_max_size"])