当前位置: 首页>>代码示例>>Python>>正文


Python ParamManager.get_upload_directory方法代码示例

本文整理汇总了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)
开发者ID:ofilangi,项目名称:askomics,代码行数:10,代码来源:ParamManager_test.py

示例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)
开发者ID:abretaud,项目名称:askomics,代码行数:11,代码来源:interface_galaxy.py

示例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
开发者ID:abretaud,项目名称:askomics,代码行数:14,代码来源:GalaxyConnector_test.py

示例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"])
开发者ID:ofilangi,项目名称:askomics,代码行数:25,代码来源:upload.py


注:本文中的askomics.libaskomics.ParamManager.ParamManager.get_upload_directory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。