本文整理汇总了Python中qisys.ui.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: configure_qtcreator
def configure_qtcreator(qibuild_cfg):
""" Configure QtCreator
"""
ide = qibuild.config.IDE()
ide.name = "QtCreator"
build_env = qibuild.config.get_build_env()
qtcreator_path = qisys.command.find_program("qtcreator", env=build_env)
if qtcreator_path:
ui.info(ui.green, "::", ui.reset, "Found QtCreator:", qtcreator_path)
mess = "Do you want to use qtcreator from %s?\n" % qtcreator_path
mess += "Answer 'no' if you installed qtcreator from Nokia's installer"
answer = qisys.interact.ask_yes_no(mess, default=True)
if not answer:
qtcreator_path = None
else:
ui.warning("QtCreator not found")
if not qtcreator_path:
qtcreator_path = qisys.interact.ask_program(
"Please enter full qtcreator path")
if not qtcreator_path:
ui.warning("Not adding config for QtCreator",
"qibuild open will not work", sep="\n")
return
ide.path = qtcreator_path
qibuild_cfg.add_ide(ide)
示例2: do
def do(args):
""" Main entry point """
force_rm = args.force_remove
tc = qitoolchain.get_toolchain(args.name)
ui.info(ui.green, "Removing toolchain", ui.blue, tc.name)
tc.remove(force_remove=force_rm)
ui.info(ui.green, "done")
示例3: do
def do(args):
""" Main entry point """
build_worktree = qibuild.parsers.get_build_worktree(args)
projects = qibuild.parsers.get_build_projects(build_worktree, args, solve_deps=False)
for project in projects:
path = qimvn.package.package(project, pom_path=args.pom, skip_test=args.skip_test)
ui.info(path)
示例4: do
def do(args):
"""Main entry point"""
# Convert 'helper' options into cmake flags
if not args.cmake_flags:
args.cmake_flags = list()
if args.effective_cplusplus:
args.cmake_flags.append("QI_EFFECTIVE_CPP=ON")
if args.werror:
args.cmake_flags.append("QI_WERROR=ON")
if args.coverage:
args.cmake_flags.append("QI_WITH_COVERAGE=ON")
# args.debug_info has 3 values: None (not set at all), True, False
if args.debug_info is True:
args.cmake_flags.append("QI_WITH_DEBUG_INFO=ON")
if args.debug_info is False:
args.cmake_flags.append("QI_WITH_DEBUG_INFO=OFF")
if args.force_32_bits:
args.cmake_flags.append("QI_FORCE_32_BITS=ON")
cmake_builder = qibuild.parsers.get_cmake_builder(args)
if args.debug_trycompile:
ui.info(ui.green, "Using cmake --debug-trycompile")
if args.trace_cmake:
ui.info(ui.green, "Tracing CMake execution")
cmake_builder.configure(clean_first=args.clean_first,
debug_trycompile=args.debug_trycompile,
trace_cmake=args.trace_cmake,
profiling=args.profiling,
summarize_options=args.summarize_options)
示例5: get_ide
def get_ide(qibuild_cfg):
"""Return an IDE to use."""
known_ides = qibuild_cfg.ides.values()
ide_names = qibuild_cfg.ides.keys()
if not known_ides:
ui.warning("No IDE configured yet")
ui.info("Tips: use `qibuild config --wizard` to configure an IDE")
return None
# Remove the one that are not supported:
supported_ides = [x for x in known_ides if x.name in SUPPORTED_IDES]
if len(supported_ides) == 1:
return supported_ides[0]
if not supported_ides:
mess = "Found those IDEs in configuration: %s\n" % ", ".join(ide_names)
mess += "But `qibuild open` only supports: %s\n" % ", ".join(SUPPORTED_IDES)
raise Exception(mess)
# User chose a specific config and an IDE matches this config
if qibuild_cfg.ide:
return qibuild_cfg.ide
supported_names = [x.name for x in supported_ides]
# Several IDEs, ask the user to choose
ide_name = qisys.interact.ask_choice(supported_names,
"Please choose an IDE to use")
if not ide_name:
return None
return qibuild_cfg.ides[ide_name]
示例6: test_convert_to_strings_unicode
def test_convert_to_strings_unicode():
""" Test Convert to Strings Unicode """
out = io.BytesIO()
ui.info("élément", ["Jérôme", "プログラミング"], fp=out)
actual = out.getvalue().decode("utf-8")
expected = "élément ['Jérôme', 'プログラミング']\n"
assert actual == expected
示例7: process
def process(input_dir, output_dir, **kwargs):
""" Process """
if not os.path.isdir(input_dir):
if os.path.exists(input_dir):
raise Exception("%s is not a directory" % input_dir)
else:
raise Exception("%s does not exist" % input_dir)
if qisys.sh.is_path_inside(output_dir, input_dir):
raise Exception("output directory is inside input directory")
ui.info(ui.green, "Generating code in", output_dir)
for root, directories, filenames in os.walk(input_dir):
rel_root = os.path.relpath(root, input_dir)
if rel_root == ".":
rel_root = ""
for directory in directories:
input_name = os.path.join(rel_root, directory)
output_name = process_string(input_name, **kwargs)
to_make = os.path.join(output_dir, output_name)
qisys.sh.mkdir(to_make, recursive=True)
for filename in filenames:
input_name = os.path.join(rel_root, filename)
output_name = process_string(input_name, **kwargs)
output_path = os.path.join(output_dir, output_name)
input_path = os.path.join(input_dir, input_name)
qisys.sh.install(input_path, output_path, quiet=True)
process_file(output_path, **kwargs)
ui.info("*", output_name)
示例8: generate_examples_zips
def generate_examples_zips(self):
for example_src in self.examples:
example_path = os.path.join(self.source_dir, example_src)
zip_path = os.path.join(self.source_dir, example_src + ".zip")
if not qisys.sh.up_to_date(zip_path, example_path):
ui.info("Generating", zip_path)
qisys.archive.compress(example_path, algo="zip", quiet=True)
示例9: split_debug
def split_debug(self, destdir, file_list):
""" Split debug symbols after install """
if self.using_visual_studio:
raise Exception("split debug not supported on Visual Studio")
ui.info(ui.green, "Splitting debug symbols from binaries ...")
tool_paths = dict()
for name in ["objcopy", "objdump"]:
tool_path = qibuild.cmake.get_binutil(name,
build_dir=self.build_directory,
env=self.build_env)
tool_paths[name] = tool_path
missing = [x for x in tool_paths if not tool_paths[x]]
if missing:
mess = """\
Could not split debug symbols from binaries for project {name}.
The following tools were not found: {missing}\
"""
mess = mess.format(name=self.name, missing = ", ".join(missing))
ui.warning(mess)
return
for filename in file_list:
full_path = os.path.join(destdir, filename[1:]) # remove starting /
if qibuild.gdb.is_elf(full_path):
qibuild.gdb.split_debug(full_path, **tool_paths)
示例10: do
def do(args):
""""Create a new project """
try:
worktree = qisys.parsers.get_worktree(args)
except qisys.worktree.NotInWorkTree:
worktree = None
project_name = os.path.basename(args.project_name)
output_dir = args.output_dir
if not output_dir:
output_dir = qisrc.templates.attached_lower(project_name)
output_dir = os.path.join(os.getcwd(), output_dir)
if os.path.exists(output_dir):
raise Exception("%s already exists" % output_dir)
template_path = args.template_path
if not template_path:
template_path = os.path.join(qisrc.QISRC_ROOT_DIR, "templates", "project")
qisrc.templates.process(template_path, output_dir, project_name=project_name)
if args.git:
qisys.command.call(["git", "init"], cwd=output_dir)
with open(os.path.join(output_dir, ".gitignore"), "w") as fp:
fp.write("build-*\n")
qisys.command.call(["git" , "add" , "."], cwd=output_dir)
qisys.command.call(["git" , "commit" , "-m" , "initial commit"], cwd=output_dir)
ui.info(ui.green, "New project initialized in", ui.bold, output_dir)
if worktree:
worktree.add_project(output_dir)
return worktree.get_project(output_dir)
示例11: do
def do(args):
""" Import a binary package into a toolchain
- Convert the binary package into a qiBuild package
- Add the qiBuild package to the cache
- Add the qiBuild package from cache to toolchain
"""
name = args.name
package_path = args.package_path
converted_package_path = convert_package(package_path, name,
interactive=args.interactive)
toolchain = qitoolchain.parsers.get_toolchain(args)
tc_packages_path = qitoolchain.toolchain.get_default_packages_path(toolchain.name)
message = """
Importing '{1}' in the toolchain {0} ...
""".format(toolchain.name, package_path)
qisys.ui.info(message)
# installation of the qiBuild package
package_dest = os.path.join(tc_packages_path, name)
qisys.sh.rm(package_dest)
with qisys.sh.TempDir() as tmp:
extracted = qisys.archive.extract(converted_package_path, tmp, quiet=True,
strict_mode=False)
qisys.sh.install(extracted, package_dest, quiet=True)
qibuild_package = qitoolchain.qipackage.QiPackage(name, path=package_dest)
toolchain.add_package(qibuild_package)
ui.info("done")
示例12: generate_mo_file
def generate_mo_file(self, locale):
""" Generate .mo file for the given locale """
ui.info(ui.green, "Generating translation for", ui.reset,
ui.bold, locale)
input_file = self.get_po_file(locale)
if not os.path.exists(input_file):
ui.error("No .po found for locale: ", locale, "\n",
"(looked in %s)" % input_file, "\n",
"Did you run qilinguist update?")
return None
output_file = os.path.join(self.mo_path, locale, "LC_MESSAGES",
self.domain + ".mo")
to_make = os.path.dirname(output_file)
qisys.sh.mkdir(to_make, recursive=True)
cmd = ["msgfmt", "--check", "--statistics"]
# required by libqi:
conf_file = os.path.join(self.mo_path, ".confintl")
with open(conf_file, "w") as fp:
fp.write("# THIS FILE IS AUTOGENERATED\n"
"# Do not delete or modify it\n"
"# This file is used to find translation dictionaries\n")
cmd.extend(["--output-file", output_file])
cmd.extend(["--directory", self.po_path])
cmd.append(input_file)
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
__out, err = process.communicate()
ui.info(err.strip())
if "untranslated" in err:
return False, "Some untranslated messages were found"
if process.returncode != 0:
return False, "msgfmt failed"
return True, ""
示例13: push
def push(project_path, branch, review=True, dry_run=False, reviewers=None):
""" Push the changes for review.
Unless review is False, in this case, simply update
the remote gerrit branch
:param reviewers: A list of reviewers to invite to review
"""
git = qisrc.git.Git(project_path)
review_remote = git.get_config("review.remote")
args = list()
if dry_run:
args.append("--dry-run")
if not review_remote:
# Repository not configured for code review:
# we just follow the normal 'git push' behavior
git.push(*args)
return
args.append(review_remote)
if review:
ui.info('Pushing code to gerrit for review.')
args.append("%s:refs/for/%s" % (branch, branch))
if reviewers:
reviewers = guess_emails(git, reviewers)
receive_pack = "git receive-pack"
for reviewer in reviewers:
receive_pack += " --reviewer=%s" % reviewer
args = ["--receive-pack=%s" % receive_pack] + args
else:
args.append("%s:%s" % (branch, branch))
git.push(*args)
示例14: check_parent_project
def check_parent_project(toc, project_name, project_path):
""" Check if the qibuild project was not found because
there was a missing
<project src= ... /> in the parent qiproject.xml file
"""
parent_proj = get_parent_project(toc, project_path)
if not parent_proj:
return
parent_qiproj = os.path.join(parent_proj.path, "qiproject.xml")
if not os.path.exists(parent_qiproj):
return
question = "Add the path to project %s to its parent qiproject.xml"
question = question % (project_name)
answer = qisys.interact.ask_yes_no(question, default=True)
if answer:
ui.info("Patching", parent_qiproj)
tree = qixml.read(parent_qiproj)
child_src = os.path.relpath(project_path, parent_proj.path)
child_src = qisys.sh.to_posix_path(child_src)
to_add = qixml.etree.Element("project")
to_add.set("src", child_src)
tree.getroot().append(to_add)
qixml.write(tree, parent_qiproj)
toc.projects = list()
toc.worktree.load()
toc.update_projects()
示例15: test_custom_sep
def test_custom_sep():
""" Test Custom Sep """
out = io.BytesIO()
ui.info("foo", "bar", sep="\n", fp=out)
actual = out.getvalue().decode("utf-8")
expected = "foo\nbar\n"
assert actual == expected