Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if sys.version_info[0] < 3:
sys.exit('Python < 3 is unsupported.')
url_template = 'https://github.com/asciinema/asciinema/archive/v%s.tar.gz'
requirements = []
setup(
name='asciinema',
version=asciinema.__version__,
packages=['asciinema', 'asciinema.commands'],
license='GNU GPLv3',
description='Terminal session recorder',
author=asciinema.__author__,
author_email='m@ku1ik.com',
url='https://asciinema.org',
download_url=(url_template % asciinema.__version__),
entry_points={
'console_scripts': [
'asciinema = asciinema.__main__:main',
],
},
install_requires=requirements,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
import sys
from setuptools import setup
if sys.version_info.major < 3:
sys.exit('Python < 3 is unsupported.')
url_template = 'https://github.com/asciinema/asciinema/archive/v%s.tar.gz'
requirements = []
test_requirements = ['nose']
with open('README.md', encoding='utf8') as file:
long_description = file.read()
setup(
name='asciinema',
version=asciinema.__version__,
packages=['asciinema', 'asciinema.commands', 'asciinema.asciicast'],
license='GNU GPLv3',
description='Terminal session recorder',
long_description=long_description,
long_description_content_type='text/markdown',
author=asciinema.__author__,
author_email='m@ku1ik.com',
url='https://asciinema.org',
download_url=(url_template % asciinema.__version__),
entry_points={
'console_scripts': [
'asciinema = asciinema.__main__:main',
],
},
package_data={'asciinema': ['data/*.png']},
data_files=[('share/doc/asciinema', ['CHANGELOG.md',
import asciinema
import sys
from setuptools import setup
if sys.version_info[0] < 3:
sys.exit('Python < 3 is unsupported.')
url_template = 'https://github.com/asciinema/asciinema/archive/v%s.tar.gz'
requirements = []
setup(
name='asciinema',
version=asciinema.__version__,
packages=['asciinema', 'asciinema.commands'],
license='GNU GPLv3',
description='Terminal session recorder',
author=asciinema.__author__,
author_email='m@ku1ik.com',
url='https://asciinema.org',
download_url=(url_template % asciinema.__version__),
entry_points={
'console_scripts': [
'asciinema = asciinema.__main__:main',
],
},
install_requires=requirements,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
def _user_agent(self):
os = re.sub('([^-]+)-(.*)', '\\1/\\2', platform.platform())
return 'asciinema/%s %s/%s %s' % (__version__,
platform.python_implementation(),
platform.python_version(),
os
)
Record terminal to local file:
\x1b[1masciinema rec demo.json\x1b[0m
Record terminal and upload it to asciinema.org, specifying title:
\x1b[1masciinema rec -t "My git tutorial"\x1b[0m
Record terminal to local file, "trimming" longer pauses to max 2.5 sec:
\x1b[1masciinema rec -w 2.5 demo.json\x1b[0m
Replay terminal recording from local file:
\x1b[1masciinema play demo.json\x1b[0m
Replay terminal recording hosted on asciinema.org:
\x1b[1masciinema play https://asciinema.org/a/difqlgx86ym6emrmd8u62yqu8\x1b[0m
For help on a specific command run:
\x1b[1masciinema -h\x1b[0m""",
formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument('--version', action='version', version='asciinema %s' % __version__)
subparsers = parser.add_subparsers()
# create the parser for the "rec" command
parser_rec = subparsers.add_parser('rec', help='Record terminal session')
parser_rec.add_argument('-c', '--command', help='command to record, defaults to $SHELL', default=cfg.record_command)
parser_rec.add_argument('-t', '--title', help='title of the asciicast')
parser_rec.add_argument('-w', '--max-wait', help='limit recorded terminal inactivity to max seconds (can be fractional)', type=positive_float, default=maybe_str(cfg.record_max_wait))
parser_rec.add_argument('-y', '--yes', help='answer "yes" to all prompts (e.g. upload confirmation)', action='store_true', default=cfg.record_yes)
parser_rec.add_argument('-q', '--quiet', help='be quiet, suppress all notices/warnings (implies -y)', action='store_true', default=cfg.record_quiet)
parser_rec.add_argument('filename', nargs='?', default='', help='filename/path to save the recording to')
parser_rec.set_defaults(func=rec_command)
# create the parser for the "play" command
parser_play = subparsers.add_parser('play', help='Replay terminal session')
parser_play.add_argument('-w', '--max-wait', help='limit terminal inactivity to max seconds (can be fractional)', type=positive_float, default=maybe_str(cfg.play_max_wait))
def _user_agent(self):
os = re.sub('([^-]+)-(.*)', '\\1/\\2', platform.platform())
return 'asciinema/%s %s/%s %s' % (__version__,
platform.python_implementation(), platform.python_version(), os)
def execute(self):
print('asciinema %s' % __version__)
Record terminal and upload it to asciinema.org, specifying title:
\x1b[1masciinema rec -t "My git tutorial"\x1b[0m
Record terminal to local file, limiting idle time to max 2.5 sec:
\x1b[1masciinema rec -i 2.5 demo.cast\x1b[0m
Replay terminal recording from local file:
\x1b[1masciinema play demo.cast\x1b[0m
Replay terminal recording hosted on asciinema.org:
\x1b[1masciinema play https://asciinema.org/a/difqlgx86ym6emrmd8u62yqu8\x1b[0m
Print full output of recorded session:
\x1b[1masciinema cat demo.cast\x1b[0m
For help on a specific command run:
\x1b[1masciinema -h\x1b[0m""",
formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument('--version', action='version', version='asciinema %s' % __version__)
subparsers = parser.add_subparsers()
# create the parser for the "rec" command
parser_rec = subparsers.add_parser('rec', help='Record terminal session')
parser_rec.add_argument('--stdin', help='enable stdin recording, disabled by default', action='store_true', default=cfg.record_stdin)
parser_rec.add_argument('--append', help='append to existing recording', action='store_true', default=False)
parser_rec.add_argument('--raw', help='save only raw stdout output', action='store_true', default=False)
parser_rec.add_argument('--overwrite', help='overwrite the file if it already exists', action='store_true', default=False)
parser_rec.add_argument('-c', '--command', help='command to record, defaults to $SHELL', default=cfg.record_command)
parser_rec.add_argument('-e', '--env', help='list of environment variables to capture, defaults to ' + config.DEFAULT_RECORD_ENV, default=cfg.record_env)
parser_rec.add_argument('-t', '--title', help='title of the asciicast')
parser_rec.add_argument('-i', '--idle-time-limit', help='limit recorded idle time to given number of seconds', type=positive_float, default=maybe_str(cfg.record_idle_time_limit))
parser_rec.add_argument('-y', '--yes', help='answer "yes" to all prompts (e.g. upload confirmation)', action='store_true', default=cfg.record_yes)
parser_rec.add_argument('-q', '--quiet', help='be quiet, suppress all notices/warnings (implies -y)', action='store_true', default=cfg.record_quiet)
parser_rec.add_argument('filename', nargs='?', default='', help='filename/path to save the recording to')
with open('README.md', encoding='utf8') as file:
long_description = file.read()
setup(
name='asciinema',
version=asciinema.__version__,
packages=['asciinema', 'asciinema.commands', 'asciinema.asciicast'],
license='GNU GPLv3',
description='Terminal session recorder',
long_description=long_description,
long_description_content_type='text/markdown',
author=asciinema.__author__,
author_email='m@ku1ik.com',
url='https://asciinema.org',
download_url=(url_template % asciinema.__version__),
entry_points={
'console_scripts': [
'asciinema = asciinema.__main__:main',
],
},
package_data={'asciinema': ['data/*.png']},
data_files=[('share/doc/asciinema', ['CHANGELOG.md',
'CODE_OF_CONDUCT.md',
'CONTRIBUTING.md',
'README.md',
'doc/asciicast-v1.md',
'doc/asciicast-v2.md']),
('share/man/man1', ['man/asciinema.1'])],
install_requires=requirements,
tests_require=test_requirements,
classifiers=[