本文整理汇总了Python中gc3libs.Application._io_spec_to_dict方法的典型用法代码示例。如果您正苦于以下问题:Python Application._io_spec_to_dict方法的具体用法?Python Application._io_spec_to_dict怎么用?Python Application._io_spec_to_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gc3libs.Application
的用法示例。
在下文中一共展示了Application._io_spec_to_dict方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_io_spec_to_dict_unicode
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import _io_spec_to_dict [as 别名]
def test_io_spec_to_dict_unicode():
import gc3libs.url
Application._io_spec_to_dict(
gc3libs.url.UrlKeyDict, {
u'/tmp/\u0246': u'\u0246',
'/tmp/b/': 'b'},
True)
示例2: test_io_spec_to_dict_unicode
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import _io_spec_to_dict [as 别名]
def test_io_spec_to_dict_unicode():
# pylint: disable=import-error,protected-access,redefined-outer-name
import gc3libs.url
with pytest.raises(gc3libs.exceptions.InvalidValue):
Application._io_spec_to_dict(
gc3libs.url.UrlKeyDict, {
u'/tmp/\u0246': u'\u0246',
'/tmp/b/': 'b'},
True)
示例3: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import _io_spec_to_dict [as 别名]
def __init__(self, executable, arguments, inputs=None, **extra_args):
# setup for finding actual files
arguments = [ str(x) for x in arguments ]
if inputs is not None:
inputs = Application._io_spec_to_dict(gc3libs.url.UrlKeyDict, inputs, True)
else:
inputs = gc3libs.url.UrlKeyDict()
# scan command-line for things that look like actual files
if os.path.exists(executable):
inputs[executable] = os.path.basename(executable)
for i, arg in enumerate(arguments):
if arg not in inputs and os.path.exists(arg):
inputs[arg] = os.path.basename(arg)
arguments[i] = os.path.basename(arg)
# recurse into superclass ctor
Application.__init__(self, executable, arguments, inputs, **extra_args)
示例4: __init__
# 需要导入模块: from gc3libs import Application [as 别名]
# 或者: from gc3libs.Application import _io_spec_to_dict [as 别名]
def __init__(self, arguments, inputs=None, *more_args, **extra_args):
# convert to string here as we want to compare args to file names
arguments = [ str(x) for x in arguments ]
# create `inputs` as would be done in the `Application` class ctor
if inputs is not None:
inputs = Application._io_spec_to_dict(
gc3libs.url.UrlKeyDict, inputs, force_abs=True)
else:
inputs = gc3libs.url.UrlKeyDict()
# scan command-line for things that look like actual files
executable = arguments[0]
if os.path.exists(executable):
executable_name = os.path.basename(executable)
inputs[executable] = executable_name
arguments[0] = './' + executable_name
for i, arg in enumerate(arguments[1:], 1):
if arg not in inputs and os.path.exists(arg):
inputs[arg] = os.path.basename(arg)
arguments[i] = os.path.basename(arg)
# recurse into superclass ctor
Application.__init__(self, arguments, inputs, *more_args, **extra_args)