You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When printing an instance of ProcessResult, if any JSON was parsed, it uses pprint.pformat to pretty print it, but that just uses too much space.
>>>d= {'author': 'The Python Packaging Authority',
... 'author_email': 'pypa-dev@googlegroups.com',
... 'bugtrack_url': None,
... 'classifiers': ['Development Status :: 3 - Alpha',
... 'Intended Audience :: Developers',
... 'License :: OSI Approved :: MIT License',
... 'Programming Language :: Python :: 2',
... 'Programming Language :: Python :: 2.6',
... 'Programming Language :: Python :: 2.7',
... 'Programming Language :: Python :: 3',
... 'Programming Language :: Python :: 3.2',
... 'Programming Language :: Python :: 3.3',
... 'Programming Language :: Python :: 3.4',
... 'Topic :: Software Development :: Build Tools'],
... 'description': 'A sample Python project\n'
... '=======================\n'
... '\n'
... 'This is the description file for the project.\n'
... '\n'
... 'The file should use UTF-8 encoding and be written using '
... 'ReStructured Text. It\n'
... 'will be used to generate the project webpage on PyPI, and '
... 'should be written for\n'
... 'that purpose.\n'
... '\n'
... 'Typical contents for this file would include an overview of '
... 'the project, basic\n'
... 'usage examples, etc. Generally, including the project '
... 'changelog in here is not\n'
... 'a good idea, although a simple "What\'s New" section for the '
... 'most recent version\n'
... 'may be appropriate.',
... 'description_content_type': None,
... 'docs_url': None,
... 'download_url': 'UNKNOWN',
... 'downloads': {'last_day': -1, 'last_month': -1, 'last_week': -1},
... 'home_page': 'https://github.com/pypa/sampleproject',
... 'keywords': 'sample setuptools development',
... 'license': 'MIT',
... 'maintainer': None,
... 'maintainer_email': None,
... 'name': 'sampleproject',
... 'package_url': 'https://pypi.org/project/sampleproject/',
... 'platform': 'UNKNOWN',
... 'project_url': 'https://pypi.org/project/sampleproject/',
... 'project_urls': {'Download': 'UNKNOWN',
... 'Homepage': 'https://github.com/pypa/sampleproject'},
... 'release_url': 'https://pypi.org/project/sampleproject/1.2.0/',
... 'requires_dist': None,
... 'requires_python': None,
... 'summary': 'A sample Python project',
... 'version': '1.2.0'}
>>>pprint.pprint(d)
{'author': 'The Python Packaging Authority',
'author_email': 'pypa-dev@googlegroups.com',
'bugtrack_url': None,
'classifiers': ['Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Build Tools'],
'description': 'A sample Python project\n''=======================\n''\n''This is the description file for the project.\n''\n''The file should use UTF-8 encoding and be written using ''ReStructured Text. It\n''will be used to generate the project webpage on PyPI, and ''should be written for\n''that purpose.\n''\n''Typical contents for this file would include an overview of ''the project, basic\n''usage examples, etc. Generally, including the project ''changelog in here is not\n''a good idea, although a simple "What\'s New" section for the ''most recent version\n''may be appropriate.',
'description_content_type': None,
'docs_url': None,
'download_url': 'UNKNOWN',
'downloads': {'last_day': -1, 'last_month': -1, 'last_week': -1},
'home_page': 'https://github.com/pypa/sampleproject',
'keywords': 'sample setuptools development',
'license': 'MIT',
'maintainer': None,
'maintainer_email': None,
'name': 'sampleproject',
'package_url': 'https://pypi.org/project/sampleproject/',
'platform': 'UNKNOWN',
'project_url': 'https://pypi.org/project/sampleproject/',
'project_urls': {'Download': 'UNKNOWN',
'Homepage': 'https://github.com/pypa/sampleproject'},
'release_url': 'https://pypi.org/project/sampleproject/1.2.0/',
'requires_dist': None,
'requires_python': None,
'summary': 'A sample Python project',
'version': '1.2.0'}
>>>print(json.dumps(d, indent=2))
{
"author": "The Python Packaging Authority",
"author_email": "pypa-dev@googlegroups.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Topic :: Software Development :: Build Tools"
],
"description": "A sample Python project\n=======================\n\nThis is the description file for the project.\n\nThe file should use UTF-8 encoding and be written using ReStructured Text. It\nwillbeusedtogeneratetheprojectwebpageonPyPI, andshouldbewrittenfor\nthatpurpose.\n\nTypicalcontentsforthisfilewouldincludeanoverviewoftheproject, basic\nusageexamples, etc. Generally, includingtheprojectchangeloginhereisnot\nagoodidea, althoughasimple \"What's New\" section for the most recent version\nmaybeappropriate.",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/pypa/sampleproject",
"keywords": "sample setuptools development",
"license": "MIT",
"maintainer": null,
"maintainer_email": null,
"name": "sampleproject",
"package_url": "https://pypi.org/project/sampleproject/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/sampleproject/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/pypa/sampleproject"
},
"release_url": "https://pypi.org/project/sampleproject/1.2.0/",
"requires_dist": null,
"requires_python": null,
"summary": "A sample Python project",
"version": "1.2.0"
}
>>>
And with salt state returns, it becomes even worse.
The text was updated successfully, but these errors were encountered:
s0undt3ch
added a commit
to s0undt3ch/pytest-shell-utilities
that referenced
this issue
Feb 23, 2024
When printing an instance of
ProcessResult
, if any JSON was parsed, it usespprint.pformat
to pretty print it, but that just uses too much space.And with salt state returns, it becomes even worse.
The text was updated successfully, but these errors were encountered: