本文整理汇总了Python中cuddlefish.rdf.RDFUpdate类的典型用法代码示例。如果您正苦于以下问题:Python RDFUpdate类的具体用法?Python RDFUpdate怎么用?Python RDFUpdate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RDFUpdate类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gen_manifest
harness_options['manifest'] = manifest.get_harness_options_manifest()
harness_options['allTestModules'] = manifest.get_all_test_modules()
from cuddlefish.rdf import gen_manifest, RDFUpdate
manifest_rdf = gen_manifest(template_root_dir=app_extension_dir,
target_cfg=target_cfg,
jid=jid,
update_url=options.update_url,
bootstrap=True,
enable_mobile=options.enable_mobile)
if command == "xpi" and options.update_link:
rdf_name = UPDATE_RDF_FILENAME % target_cfg.name
print >>stdout, "Exporting update description to %s." % rdf_name
update = RDFUpdate()
update.add(manifest_rdf, options.update_link)
open(rdf_name, "w").write(str(update))
# ask the manifest what files were used, so we can construct an XPI
# without the rest. This will include the loader (and everything it
# uses) because of the "loader_modules" starting points we passed to
# build_manifest earlier
used_files = None
if command == "xpi":
used_files = set(manifest.get_used_files())
if options.no_strip_xpi:
used_files = None # disables the filter, includes all files
if command == 'xpi':
示例2: run
#.........这里部分代码省略.........
'classID': '{%s}' % harness_guid
},
'jetpackID': jid,
'bundleID': bundle_id,
'staticArgs': options.static_args,
'name': target,
}
harness_options.update(build)
if command == "test":
# This should be contained in the test runner package.
harness_options['main'] = 'run-tests'
else:
harness_options['main'] = target_cfg.get('main')
for option in inherited_options:
harness_options[option] = getattr(options, option)
harness_options['metadata'] = packaging.get_metadata(pkg_cfg, deps)
sdk_version = get_version(env_root)
harness_options['sdkVersion'] = sdk_version
packaging.call_plugins(pkg_cfg, deps)
retval = 0
if options.templatedir:
app_extension_dir = os.path.abspath(options.templatedir)
else:
mydir = os.path.dirname(os.path.abspath(__file__))
if sys.platform == "darwin":
# If we're on OS X, at least point into the XULRunner
# app dir so we run as a proper app if using XULRunner.
app_extension_dir = os.path.join(mydir, "Test App.app",
"Contents", "Resources")
else:
app_extension_dir = os.path.join(mydir, "app-extension")
from cuddlefish.manifest import build_manifest
uri_prefix = "resource://%s" % unique_prefix
include_tests = False #bool(command=="test")
manifest = build_manifest(target_cfg, pkg_cfg, deps, uri_prefix, include_tests)
harness_options['manifest'] = manifest.get_harness_options_manifest(uri_prefix)
if command == 'xpi':
from cuddlefish.xpi import build_xpi
from cuddlefish.rdf import gen_manifest, RDFUpdate
manifest_rdf = gen_manifest(template_root_dir=app_extension_dir,
target_cfg=target_cfg,
bundle_id=bundle_id,
update_url=options.update_url,
bootstrap=True)
if options.update_link:
rdf_name = UPDATE_RDF_FILENAME % target_cfg.name
print "Exporting update description to %s." % rdf_name
update = RDFUpdate()
update.add(manifest_rdf, options.update_link)
open(rdf_name, "w").write(str(update))
xpi_name = XPI_FILENAME % target_cfg.name
print "Exporting extension to %s." % xpi_name
build_xpi(template_root_dir=app_extension_dir,
manifest=manifest_rdf,
xpi_name=xpi_name,
harness_options=harness_options)
else:
if options.use_server:
from cuddlefish.server import run_app
else:
from cuddlefish.runner import run_app
if options.profiledir:
options.profiledir = os.path.expanduser(options.profiledir)
options.profiledir = os.path.abspath(options.profiledir)
if options.addons is not None:
options.addons = options.addons.split(",")
try:
retval = run_app(harness_root_dir=app_extension_dir,
harness_options=harness_options,
app_type=options.app,
binary=options.binary,
profiledir=options.profiledir,
verbose=options.verbose,
timeout=timeout,
logfile=options.logfile,
addons=options.addons,
args=options.cmdargs,
norun=options.no_run)
except Exception, e:
if str(e).startswith(MOZRUNNER_BIN_NOT_FOUND):
print >>sys.stderr, MOZRUNNER_BIN_NOT_FOUND_HELP.strip()
retval = -1
else:
raise
示例3: run
#.........这里部分代码省略.........
identifier = target_cfg.get("id", "{%s}" % harness_guid)
timeout = None
targets = [target]
if not use_main:
timeout = TEST_RUN_TIMEOUT
targets.append("test-harness")
if options.extra_packages:
targets.extend(options.extra_packages.split(","))
deps = packaging.get_deps_for_targets(pkg_cfg, targets)
build = packaging.generate_build_for_target(
pkg_cfg, target, deps, prefix=unique_prefix, include_dep_tests=options.dep_tests
)
if "resources" in build:
resources = build.resources
for name in resources:
resources[name] = os.path.abspath(resources[name])
dep_xpt_dirs = []
for dep in deps:
dep_cfg = pkg_cfg.packages[dep]
if "xpcom" in dep_cfg and "typelibs" in dep_cfg.xpcom:
abspath = packaging.resolve_dir(dep_cfg, dep_cfg.xpcom.typelibs)
dep_xpt_dirs.append(abspath)
xpts = get_xpts(dep_xpt_dirs)
harness_contract_id = "@mozilla.org/harness-service;1?id=%s" % identifier
harness_options = {"bootstrap": {"contractID": harness_contract_id, "classID": "{%s}" % harness_guid}}
harness_options.update(build)
inherited_options = ["verbose"]
if use_main:
harness_options["main"] = target_cfg.get("main")
else:
harness_options["main"] = "run-tests"
inherited_options.extend(["iterations"])
for option in inherited_options:
harness_options[option] = getattr(options, option)
harness_options["metadata"] = packaging.get_metadata(pkg_cfg, deps)
packaging.call_plugins(pkg_cfg, deps)
retval = 0
if options.templatedir:
app_extension_dir = os.path.abspath(options.templatedir)
else:
app_extension_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "app-extension")
if command == "xpi":
from cuddlefish.xpi import build_xpi
from cuddlefish.rdf import gen_manifest, RDFUpdate
manifest = gen_manifest(
template_root_dir=app_extension_dir,
target_cfg=target_cfg,
default_id=identifier,
update_url=options.update_url,
)
if options.update_link:
rdf_name = UPDATE_RDF_FILENAME % target_cfg.name
print "Exporting update description to %s." % rdf_name
update = RDFUpdate()
update.add(manifest, options.update_link)
open(rdf_name, "w").write(str(update))
xpi_name = XPI_FILENAME % target_cfg.name
print "Exporting extension to %s." % xpi_name
build_xpi(
template_root_dir=app_extension_dir,
manifest=manifest,
xpi_name=xpi_name,
harness_options=harness_options,
xpts=xpts,
)
else:
if options.use_server:
from cuddlefish.server import run_app
else:
from cuddlefish.runner import run_app
retval = run_app(
harness_root_dir=app_extension_dir,
harness_options=harness_options,
xpts=xpts,
app_type=options.app,
binary=options.binary,
verbose=options.verbose,
no_quit=options.no_quit,
timeout=timeout,
)
sys.exit(retval)
示例4: run
#.........这里部分代码省略.........
abspath = packaging.resolve_dir(dep_cfg, dep_cfg.xpcom.typelibs)
dep_xpt_dirs.append(abspath)
xpts = get_xpts(dep_xpt_dirs)
harness_contract_id = "@mozilla.org/harness-service;1?id=%s" % jid
harness_options = {
"bootstrap": {"contractID": harness_contract_id, "classID": "{%s}" % harness_guid},
"jetpackID": jid,
"bundleID": bundle_id,
}
harness_options.update(build)
inherited_options = ["verbose"]
if use_main:
harness_options["main"] = target_cfg.get("main")
else:
harness_options["main"] = "run-tests"
inherited_options.extend(["iterations", "filter", "profileMemory"])
for option in inherited_options:
harness_options[option] = getattr(options, option)
harness_options["metadata"] = packaging.get_metadata(pkg_cfg, deps)
packaging.call_plugins(pkg_cfg, deps)
retval = 0
if options.templatedir:
app_extension_dir = os.path.abspath(options.templatedir)
else:
mydir = os.path.dirname(os.path.abspath(__file__))
if sys.platform == "darwin":
# If we're on OS X, at least point into the XULRunner
# app dir so we run as a proper app if using XULRunner.
app_extension_dir = os.path.join(mydir, "Test App.app", "Contents", "Resources")
else:
app_extension_dir = os.path.join(mydir, "app-extension")
if command == "xpi":
from cuddlefish.xpi import build_xpi
from cuddlefish.rdf import gen_manifest, RDFUpdate
manifest = gen_manifest(
template_root_dir=app_extension_dir,
target_cfg=target_cfg,
bundle_id=bundle_id,
update_url=options.update_url,
bootstrap=True,
)
if options.update_link:
rdf_name = UPDATE_RDF_FILENAME % target_cfg.name
print "Exporting update description to %s." % rdf_name
update = RDFUpdate()
update.add(manifest, options.update_link)
open(rdf_name, "w").write(str(update))
xpi_name = XPI_FILENAME % target_cfg.name
print "Exporting extension to %s." % xpi_name
build_xpi(
template_root_dir=app_extension_dir,
manifest=manifest,
xpi_name=xpi_name,
harness_options=harness_options,
xpts=xpts,
)
else:
if options.use_server:
from cuddlefish.server import run_app
else:
from cuddlefish.runner import run_app
if options.profiledir:
options.profiledir = os.path.expanduser(options.profiledir)
options.profiledir = os.path.abspath(options.profiledir)
if options.addons is not None:
options.addons = options.addons.split(",")
try:
retval = run_app(
harness_root_dir=app_extension_dir,
harness_options=harness_options,
xpts=xpts,
app_type=options.app,
binary=options.binary,
profiledir=options.profiledir,
verbose=options.verbose,
timeout=timeout,
logfile=options.logfile,
addons=options.addons,
)
except Exception, e:
if e.message.startswith(MOZRUNNER_BIN_NOT_FOUND):
print >> sys.stderr, MOZRUNNER_BIN_NOT_FOUND_HELP.strip()
retval = -1
else:
raise