ar08 commited on
Commit
0b8e48f
·
verified ·
1 Parent(s): c2c23cd

Upload 10 files

Browse files

![pyxtermjs.gif](https://cdn-uploads.huggingface.co/production/uploads/6627749287a39d8863764901/jS5Bb_DYx_aamblir5VQ0.gif)

Files changed (10) hide show
  1. .gitignore +7 -0
  2. CHANGELOG.md +14 -0
  3. LICENSE +21 -0
  4. MANIFEST.in +2 -0
  5. makefile +11 -0
  6. noxfile.py +63 -0
  7. pyxtermjs.gif +0 -0
  8. requirements.in +1 -0
  9. requirements.txt +26 -0
  10. setup.py +74 -0
.gitignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ dist
2
+ .DS_Store
3
+ venv
4
+ .vscode
5
+ *egg-info*
6
+ build
7
+ __pycache__
CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## 0.5.0.2
2
+
3
+ - support copy and paste in terminal (#27)
4
+
5
+ ## 0.5.0.1
6
+
7
+ - Do not fail on unicode decode errors
8
+ - Cast port argument as an integer
9
+
10
+ ## 0.5.0.0
11
+
12
+ - Update dependencies xtermjs and socketio
13
+ - Turn off flask's logging
14
+ - Update setup.py to install from pinned dependencies in requirements.tx
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Chad Smith
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
MANIFEST.in ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ include README.md LICENSE requirements.txt
2
+ recursive-include pyxtermjs *
makefile ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .PHONY: clean build publish
2
+
3
+ build: clean
4
+ python3 -m pip install --upgrade --quiet setuptools wheel twine
5
+ python3 setup.py --quiet sdist bdist_wheel
6
+
7
+ publish: build
8
+ python3 -m twine upload dist/*
9
+
10
+ clean:
11
+ rm -r build dist *.egg-info || true
noxfile.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+ import sys
3
+ from pathlib import Path
4
+
5
+ import nox # type: ignore
6
+
7
+ nox.options.reuse_existing_virtualenvs = True
8
+
9
+
10
+ @nox.session()
11
+ def run(session):
12
+ session.install(".")
13
+ session.run("python", "-m", "pyxtermjs", *session.posargs)
14
+
15
+
16
+ def has_changes():
17
+ status = (
18
+ subprocess.run(
19
+ "git status --porcelain", shell=True, check=True, stdout=subprocess.PIPE
20
+ )
21
+ .stdout.decode()
22
+ .strip()
23
+ )
24
+ return len(status) > 0
25
+
26
+
27
+ def on_master_no_changes(session):
28
+ if has_changes():
29
+ session.error("All changes must be committed or removed before publishing")
30
+ # branch = get_branch()
31
+ # if branch != "master":
32
+ # session.error(f"Must be on 'master' branch. Currently on {branch!r} branch")
33
+
34
+
35
+ def get_branch():
36
+ return (
37
+ subprocess.run(
38
+ "git rev-parse --abbrev-ref HEAD",
39
+ shell=True,
40
+ check=True,
41
+ stdout=subprocess.PIPE,
42
+ )
43
+ .stdout.decode()
44
+ .strip()
45
+ )
46
+
47
+
48
+ @nox.session()
49
+ def build(session):
50
+ session.install("--upgrade", "pip")
51
+ session.install("build")
52
+ session.run("rm", "-rf", "dist", "build", external=True)
53
+ session.run("python", "-m", "build")
54
+
55
+
56
+ @nox.session()
57
+ def publish(session):
58
+ on_master_no_changes(session)
59
+ session.install("--upgrade", "pip")
60
+ session.install("twine")
61
+ build(session)
62
+ print("REMINDER: Has the changelog been updated?")
63
+ session.run("python", "-m", "twine", "upload", "dist/*")
pyxtermjs.gif ADDED
requirements.in ADDED
@@ -0,0 +1 @@
 
 
1
+ flask-socketio==5.1.1
requirements.txt ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # This file is autogenerated by pip-compile with python 3.8
3
+ # To update, run:
4
+ #
5
+ # pip-compile requirements.in
6
+ #
7
+ bidict==0.21.2
8
+ # via python-socketio
9
+ click==8.0.1
10
+ # via flask
11
+ flask==2.0.1
12
+ # via flask-socketio
13
+ flask-socketio==5.1.1
14
+ # via -r requirements.in
15
+ itsdangerous==2.0.1
16
+ # via flask
17
+ jinja2==3.0.1
18
+ # via flask
19
+ markupsafe==2.0.1
20
+ # via jinja2
21
+ python-engineio==4.2.1
22
+ # via python-socketio
23
+ python-socketio==5.4.0
24
+ # via flask-socketio
25
+ werkzeug==2.0.1
26
+ # via flask
setup.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+
3
+ import sys
4
+
5
+ if sys.version_info < (3, 6, 0):
6
+ print("Python 3.6+ is required")
7
+ exit(1)
8
+ import io # noqa E402
9
+ import os # noqa E402
10
+ from setuptools import find_packages, setup # noqa E402
11
+ from pathlib import Path # noqa E402
12
+ from typing import List # noqa E402
13
+ import ast # noqa E402
14
+ import re # noqa E402
15
+ import distutils.text_file
16
+
17
+ CURDIR = Path(__file__).parent
18
+
19
+ EXCLUDE_FROM_PACKAGES = ["tests"]
20
+
21
+
22
+ with io.open(os.path.join(CURDIR, "README.md"), "r", encoding="utf-8") as f:
23
+ README = f.read()
24
+
25
+
26
+ def get_version() -> str:
27
+ main_file = CURDIR / "pyxtermjs" / "app.py"
28
+ _version_re = re.compile(r"__version__\s+=\s+(?P<version>.*)")
29
+ with open(main_file, "r", encoding="utf8") as f:
30
+ match = _version_re.search(f.read())
31
+ version = match.group("version") if match is not None else '"unknown"'
32
+ return str(ast.literal_eval(version))
33
+
34
+
35
+ setup(
36
+ name="pyxtermjs",
37
+ version=get_version(),
38
+ author="Chad Smith",
39
+ author_email="chadsmith.software@gmail.com",
40
+ description="interactive terminal in the browser",
41
+ long_description=README,
42
+ long_description_content_type="text/markdown",
43
+ url="https://github.com/cs01/pyxtermjs",
44
+ license="License :: OSI Approved :: MIT License",
45
+ packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
46
+ include_package_data=True,
47
+ keywords=[
48
+ "xterm",
49
+ "xterm.js",
50
+ "javascript",
51
+ "terminal-emulators",
52
+ "browser",
53
+ "tty",
54
+ "pty",
55
+ "console",
56
+ "terminal",
57
+ ],
58
+ scripts=[],
59
+ entry_points={"console_scripts": ["pyxtermjs = pyxtermjs.app:main"]},
60
+ extras_require={},
61
+ zip_safe=False,
62
+ python_requires=">=3.6",
63
+ install_requires=distutils.text_file.TextFile(
64
+ filename="./requirements.txt"
65
+ ).readlines(),
66
+ classifiers=[
67
+ "Operating System :: OS Independent",
68
+ "License :: OSI Approved :: MIT License",
69
+ "Programming Language :: Python",
70
+ "Programming Language :: Python :: 3.6",
71
+ "Programming Language :: Python :: 3.7",
72
+ "Programming Language :: Python :: 3 :: Only",
73
+ ],
74
+ )