MCPcopy Create free account
hub / github.com/sublimehq/package_control / console_write

Function console_write

package_control/console_write.py:6–32  ·  view source on GitHub ↗

Writes a value to the Sublime Text console, formatting it for output via text.format() and then encoding unicode to utf-8 :param string: The value to write :param params: Params to interpolate into the string using the % operator :param strip: If a sin

(string, params=None, strip=True, indent=None, prefix=True)

Source from the content-addressed store, hash-verified

4
5
6def console_write(string, params=None, strip=True, indent=None, prefix=True):
7 """
8 Writes a value to the Sublime Text console, formatting it for output via
9 text.format() and then encoding unicode to utf-8
10
11 :param string:
12 The value to write
13
14 :param params:
15 Params to interpolate into the string using the % operator
16
17 :param strip:
18 If a single trailing newline should be stripped
19
20 :param indent:
21 If all lines should be indented by a set indent after being de-dented
22
23 :param prefix:
24 If the string "Package Control: " should be prefixed to the string
25 """
26
27 string = text.format(str(string), params, strip=strip, indent=indent)
28
29 if prefix:
30 sys.stdout.write('Package Control: ')
31
32 print(string)

Callers 15

create_empty_fileFunction · 0.90
_read_zip_fileFunction · 0.90
zip_file_existsFunction · 0.90
install_packagesMethod · 0.90
upgrade_packagesMethod · 0.90
remove_packagesMethod · 0.90
satisfy_packagesMethod · 0.90
run_install_tasksMethod · 0.90
run_upgrade_tasksMethod · 0.90
_migrate_dependenciesFunction · 0.90
_install_injectorsFunction · 0.90
__init__Method · 0.90

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected