當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。