k3thread 0.1.3__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
k3thread-0.1.4/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 张炎泼
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.
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: k3thread
3
+ Version: 0.1.4
4
+ Summary: Thread utilities for daemon threads and exception sending
5
+ Author-email: Zhang Yanpo <drdr.xp@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/pykit3/k3thread
8
+ Project-URL: Documentation, https://k3thread.readthedocs.io
9
+ Keywords: thread,daemon,concurrent,exception
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Libraries
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0; extra == "dev"
24
+ Requires-Dist: ruff; extra == "dev"
25
+ Requires-Dist: coverage; extra == "dev"
26
+ Provides-Extra: publish
27
+ Requires-Dist: build; extra == "publish"
28
+ Requires-Dist: twine; extra == "publish"
29
+ Requires-Dist: pk3; extra == "publish"
30
+ Provides-Extra: docs
31
+ Requires-Dist: mkdocs>=1.5; extra == "docs"
32
+ Requires-Dist: mkdocs-material>=9.0; extra == "docs"
33
+ Requires-Dist: mkdocstrings[python]>=0.24; extra == "docs"
34
+ Dynamic: license-file
35
+
36
+ # k3thread
37
+
38
+ [![Build Status](https://travis-ci.com/pykit3/k3thread.svg?branch=master)](https://travis-ci.com/pykit3/k3thread)
39
+ ![Python package](https://github.com/pykit3/k3thread/workflows/Python%20package/badge.svg)
40
+ [![Documentation Status](https://readthedocs.org/projects/k3thread/badge/?version=stable)](https://k3thread.readthedocs.io/en/stable/?badge=stable)
41
+ [![Package](https://img.shields.io/pypi/pyversions/k3thread)](https://pypi.org/project/k3thread)
42
+
43
+ utility to create thread.
44
+
45
+ k3thread is a component of [pykit3] project: a python3 toolkit set.
46
+
47
+
48
+ k3thread is utility to create and operate thread.
49
+
50
+ Start a daemon thread after 0.2 seconds::
51
+
52
+ >>> th = daemon(lambda :1, after=0.2)
53
+
54
+ Stop a thread by sending a exception::
55
+
56
+ import time
57
+
58
+ def busy():
59
+ while True:
60
+ time.sleep(0.1)
61
+
62
+ t = daemon(busy)
63
+ send_exception(t, SystemExit)
64
+
65
+
66
+
67
+
68
+ # Install
69
+
70
+ ```
71
+ pip install k3thread
72
+ ```
73
+
74
+ # Synopsis
75
+
76
+ ```python
77
+ >>> th = daemon(lambda :1, after=0.2)
78
+
79
+ ```
80
+
81
+ # Author
82
+
83
+ Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
84
+
85
+ # Copyright and License
86
+
87
+ The MIT License (MIT)
88
+
89
+ Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
90
+
91
+
92
+ [pykit3]: https://github.com/pykit3
@@ -0,0 +1,57 @@
1
+ # k3thread
2
+
3
+ [![Build Status](https://travis-ci.com/pykit3/k3thread.svg?branch=master)](https://travis-ci.com/pykit3/k3thread)
4
+ ![Python package](https://github.com/pykit3/k3thread/workflows/Python%20package/badge.svg)
5
+ [![Documentation Status](https://readthedocs.org/projects/k3thread/badge/?version=stable)](https://k3thread.readthedocs.io/en/stable/?badge=stable)
6
+ [![Package](https://img.shields.io/pypi/pyversions/k3thread)](https://pypi.org/project/k3thread)
7
+
8
+ utility to create thread.
9
+
10
+ k3thread is a component of [pykit3] project: a python3 toolkit set.
11
+
12
+
13
+ k3thread is utility to create and operate thread.
14
+
15
+ Start a daemon thread after 0.2 seconds::
16
+
17
+ >>> th = daemon(lambda :1, after=0.2)
18
+
19
+ Stop a thread by sending a exception::
20
+
21
+ import time
22
+
23
+ def busy():
24
+ while True:
25
+ time.sleep(0.1)
26
+
27
+ t = daemon(busy)
28
+ send_exception(t, SystemExit)
29
+
30
+
31
+
32
+
33
+ # Install
34
+
35
+ ```
36
+ pip install k3thread
37
+ ```
38
+
39
+ # Synopsis
40
+
41
+ ```python
42
+ >>> th = daemon(lambda :1, after=0.2)
43
+
44
+ ```
45
+
46
+ # Author
47
+
48
+ Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
49
+
50
+ # Copyright and License
51
+
52
+ The MIT License (MIT)
53
+
54
+ Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
55
+
56
+
57
+ [pykit3]: https://github.com/pykit3
@@ -18,8 +18,9 @@ Stop a thread by sending a exception::
18
18
 
19
19
  """
20
20
 
21
- __version__ = "0.1.3"
22
- __name__ = "k3thread"
21
+ from importlib.metadata import version
22
+
23
+ __version__ = version("k3thread")
23
24
 
24
25
  from .thd import InvalidThreadIdError
25
26
  from .thd import SendRaiseError
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: k3thread
3
+ Version: 0.1.4
4
+ Summary: Thread utilities for daemon threads and exception sending
5
+ Author-email: Zhang Yanpo <drdr.xp@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/pykit3/k3thread
8
+ Project-URL: Documentation, https://k3thread.readthedocs.io
9
+ Keywords: thread,daemon,concurrent,exception
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Libraries
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0; extra == "dev"
24
+ Requires-Dist: ruff; extra == "dev"
25
+ Requires-Dist: coverage; extra == "dev"
26
+ Provides-Extra: publish
27
+ Requires-Dist: build; extra == "publish"
28
+ Requires-Dist: twine; extra == "publish"
29
+ Requires-Dist: pk3; extra == "publish"
30
+ Provides-Extra: docs
31
+ Requires-Dist: mkdocs>=1.5; extra == "docs"
32
+ Requires-Dist: mkdocs-material>=9.0; extra == "docs"
33
+ Requires-Dist: mkdocstrings[python]>=0.24; extra == "docs"
34
+ Dynamic: license-file
35
+
36
+ # k3thread
37
+
38
+ [![Build Status](https://travis-ci.com/pykit3/k3thread.svg?branch=master)](https://travis-ci.com/pykit3/k3thread)
39
+ ![Python package](https://github.com/pykit3/k3thread/workflows/Python%20package/badge.svg)
40
+ [![Documentation Status](https://readthedocs.org/projects/k3thread/badge/?version=stable)](https://k3thread.readthedocs.io/en/stable/?badge=stable)
41
+ [![Package](https://img.shields.io/pypi/pyversions/k3thread)](https://pypi.org/project/k3thread)
42
+
43
+ utility to create thread.
44
+
45
+ k3thread is a component of [pykit3] project: a python3 toolkit set.
46
+
47
+
48
+ k3thread is utility to create and operate thread.
49
+
50
+ Start a daemon thread after 0.2 seconds::
51
+
52
+ >>> th = daemon(lambda :1, after=0.2)
53
+
54
+ Stop a thread by sending a exception::
55
+
56
+ import time
57
+
58
+ def busy():
59
+ while True:
60
+ time.sleep(0.1)
61
+
62
+ t = daemon(busy)
63
+ send_exception(t, SystemExit)
64
+
65
+
66
+
67
+
68
+ # Install
69
+
70
+ ```
71
+ pip install k3thread
72
+ ```
73
+
74
+ # Synopsis
75
+
76
+ ```python
77
+ >>> th = daemon(lambda :1, after=0.2)
78
+
79
+ ```
80
+
81
+ # Author
82
+
83
+ Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
84
+
85
+ # Copyright and License
86
+
87
+ The MIT License (MIT)
88
+
89
+ Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
90
+
91
+
92
+ [pykit3]: https://github.com/pykit3
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ README.md
3
+ __init__.py
4
+ pyproject.toml
5
+ thd.py
6
+ ./__init__.py
7
+ ./thd.py
8
+ k3thread.egg-info/PKG-INFO
9
+ k3thread.egg-info/SOURCES.txt
10
+ k3thread.egg-info/dependency_links.txt
11
+ k3thread.egg-info/requires.txt
12
+ k3thread.egg-info/top_level.txt
13
+ test/test_doctest.py
14
+ test/test_thd.py
@@ -0,0 +1,15 @@
1
+
2
+ [dev]
3
+ pytest>=7.0
4
+ ruff
5
+ coverage
6
+
7
+ [docs]
8
+ mkdocs>=1.5
9
+ mkdocs-material>=9.0
10
+ mkdocstrings[python]>=0.24
11
+
12
+ [publish]
13
+ build
14
+ twine
15
+ pk3
@@ -0,0 +1,57 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "k3thread"
7
+ version = "0.1.4"
8
+ description = "Thread utilities for daemon threads and exception sending"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.9"
12
+ authors = [
13
+ { name = "Zhang Yanpo", email = "drdr.xp@gmail.com" }
14
+ ]
15
+ keywords = ["thread", "daemon", "concurrent", "exception"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "Topic :: Software Development :: Libraries",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ ]
27
+ dependencies = []
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/pykit3/k3thread"
31
+ Documentation = "https://k3thread.readthedocs.io"
32
+
33
+ [project.optional-dependencies]
34
+ dev = [
35
+ "pytest>=7.0",
36
+ "ruff",
37
+ "coverage",
38
+ ]
39
+ publish = [
40
+ "build",
41
+ "twine",
42
+ "pk3",
43
+ ]
44
+ docs = [
45
+ "mkdocs>=1.5",
46
+ "mkdocs-material>=9.0",
47
+ "mkdocstrings[python]>=0.24",
48
+ ]
49
+
50
+ [tool.setuptools]
51
+ packages = ["k3thread"]
52
+
53
+ [tool.setuptools.package-dir]
54
+ k3thread = "."
55
+
56
+ [tool.ruff]
57
+ line-length = 120
@@ -0,0 +1,8 @@
1
+ import doctest
2
+
3
+ import k3thread
4
+
5
+
6
+ def load_tests(loader, tests, ignore):
7
+ tests.addTests(doctest.DocTestSuite(k3thread))
8
+ return tests
@@ -0,0 +1,139 @@
1
+ import sys
2
+ import time
3
+ import unittest
4
+
5
+ import k3thread
6
+ import k3ut
7
+
8
+ dd = k3ut.dd
9
+
10
+
11
+ def _work(sess):
12
+ try:
13
+ while True:
14
+ _ = 1
15
+
16
+ except SystemExit:
17
+ sess["raised"] = True
18
+
19
+
20
+ class TestThread(unittest.TestCase):
21
+ def _verify_exception_raised(self, sess, thread):
22
+ # we wait few seconds for the exception to be raised.
23
+ for _ in range(100):
24
+ if sess["raised"]:
25
+ # The thread might still be alive at this point.
26
+ time.sleep(0.2)
27
+ self.assertFalse(thread.is_alive())
28
+ break
29
+
30
+ time.sleep(0.1)
31
+
32
+ else:
33
+ assert False, "SystemError is not raised"
34
+
35
+ def test_send_exception(self):
36
+ # send_exception does not work with PyPy
37
+ if "PyPy" in sys.version:
38
+ return
39
+
40
+ sess = {"raised": False}
41
+
42
+ t = k3thread.start(_work, args=(sess,), daemon=True)
43
+ self.assertFalse(sess["raised"])
44
+
45
+ with self.assertRaises(TypeError):
46
+ k3thread.send_exception("thread", SystemExit)
47
+
48
+ with self.assertRaises(TypeError):
49
+ k3thread.send_exception(t, SystemExit())
50
+
51
+ class SomeClass(object):
52
+ pass
53
+
54
+ with self.assertRaises(ValueError):
55
+ k3thread.send_exception(t, SomeClass)
56
+
57
+ k3thread.send_exception(t, SystemExit)
58
+ self._verify_exception_raised(sess, t)
59
+
60
+ def test_send_exception_many_times(self):
61
+ # send_exception does not work with PyPy
62
+ if "PyPy" in sys.version:
63
+ return
64
+
65
+ sess = {"raised": False}
66
+
67
+ t = k3thread.start(_work, args=(sess,), daemon=True)
68
+ self.assertFalse(sess["raised"])
69
+
70
+ for _ in range(5):
71
+ try:
72
+ k3thread.send_exception(t, SystemExit)
73
+ except k3thread.InvalidThreadIdError:
74
+ # This will happen if the thread is already terminated by
75
+ # a previous send_exception call.
76
+ pass
77
+
78
+ self._verify_exception_raised(sess, t)
79
+
80
+ # Raising in a dead thread shoud not break.
81
+ with self.assertRaises(k3thread.InvalidThreadIdError):
82
+ k3thread.send_exception(t, SystemExit)
83
+
84
+ def test_start(self):
85
+ def _sort(a, reverse=False):
86
+ a.sort(reverse=reverse)
87
+
88
+ array = [3, 1, 2]
89
+ t = k3thread.start(_sort, args=(array,))
90
+ t.join()
91
+
92
+ self.assertEqual(array, [1, 2, 3])
93
+
94
+ t = k3thread.start(_sort, args=(array,), kwargs={"reverse": True})
95
+ t.join()
96
+
97
+ self.assertEqual(array, [3, 2, 1])
98
+
99
+ def test_daemon(self):
100
+ def noop():
101
+ return None
102
+
103
+ # Thread should be non-daemon by default
104
+ t = k3thread.start(noop)
105
+ self.assertFalse(t.daemon)
106
+
107
+ t = k3thread.start(noop, daemon=True)
108
+ self.assertTrue(t.daemon)
109
+
110
+ t = k3thread.daemon(noop)
111
+ self.assertTrue(t.daemon)
112
+
113
+ def test_thread_after(self):
114
+ def _do():
115
+ pass
116
+
117
+ with k3ut.Timer() as t:
118
+ th = k3thread.start(target=_do, after=None)
119
+ th.join()
120
+ self.assertAlmostEqual(0, t.spent(), delta=0.1)
121
+
122
+ with k3ut.Timer() as t:
123
+ th = k3thread.start(target=_do, after=0.5)
124
+ th.join()
125
+ self.assertAlmostEqual(0.5, t.spent(), delta=0.1)
126
+
127
+ def test_daemon_after(self):
128
+ def _do():
129
+ pass
130
+
131
+ with k3ut.Timer() as t:
132
+ th = k3thread.daemon(target=_do, after=None)
133
+ th.join()
134
+ self.assertAlmostEqual(0, t.spent(), delta=0.1)
135
+
136
+ with k3ut.Timer() as t:
137
+ th = k3thread.daemon(target=_do, after=0.5)
138
+ th.join()
139
+ self.assertAlmostEqual(0.5, t.spent(), delta=0.1)
@@ -59,6 +59,7 @@ def start(target, name=None, args=None, kwargs=None, daemon=False, after=None):
59
59
  if after is None:
60
60
  _target = target
61
61
  else:
62
+
62
63
  def _target(*args, **kwargs):
63
64
  time.sleep(after)
64
65
  target(*args, **kwargs)
@@ -76,8 +77,7 @@ def daemon(target, name=None, args=None, kwargs=None, after=None):
76
77
  It is same as `start()` except that it sets argument `daemon=True`.
77
78
  """
78
79
 
79
- return start(target, name=name, args=args, kwargs=kwargs,
80
- daemon=True, after=after)
80
+ return start(target, name=name, args=args, kwargs=kwargs, daemon=True, after=after)
81
81
 
82
82
 
83
83
  def send_exception(thread, exctype):
@@ -133,8 +133,7 @@ def _async_raise(tid, exctype):
133
133
  # PyThreadState_SetAsyncExc requires GIL to be held
134
134
  gil_state = ctypes.pythonapi.PyGILState_Ensure()
135
135
  try:
136
- res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid),
137
- ctypes.py_object(exctype))
136
+ res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), ctypes.py_object(exctype))
138
137
  if res == 0:
139
138
  # The thread is likely dead already.
140
139
  raise InvalidThreadIdError(tid)
k3thread-0.1.3/PKG-INFO DELETED
@@ -1,76 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: k3thread
3
- Version: 0.1.3
4
- Summary: utility to create thread.
5
- Home-page: https://github.com/pykit3/k3thread
6
- Author: Zhang Yanpo
7
- Author-email: drdr.xp@gmail.com
8
- License: MIT
9
- Description: # k3thread
10
-
11
- [![Build Status](https://travis-ci.com/pykit3/k3thread.svg?branch=master)](https://travis-ci.com/pykit3/k3thread)
12
- ![Python package](https://github.com/pykit3/k3thread/workflows/Python%20package/badge.svg)
13
- [![Documentation Status](https://readthedocs.org/projects/k3thread/badge/?version=stable)](https://k3thread.readthedocs.io/en/stable/?badge=stable)
14
- [![Package](https://img.shields.io/pypi/pyversions/k3thread)](https://pypi.org/project/k3thread)
15
-
16
- utility to create thread.
17
-
18
- k3thread is a component of [pykit3] project: a python3 toolkit set.
19
-
20
-
21
- k3thread is utility to create and operate thread.
22
-
23
- Start a daemon thread after 0.2 seconds::
24
-
25
- >>> th = daemon(lambda :1, after=0.2)
26
-
27
- Stop a thread by sending a exception::
28
-
29
- import time
30
-
31
- def busy():
32
- while True:
33
- time.sleep(0.1)
34
-
35
- t = daemon(busy)
36
- send_exception(t, SystemExit)
37
-
38
-
39
-
40
-
41
- # Install
42
-
43
- ```
44
- pip install k3thread
45
- ```
46
-
47
- # Synopsis
48
-
49
- ```python
50
- >>> th = daemon(lambda :1, after=0.2)
51
-
52
- ```
53
-
54
- # Author
55
-
56
- Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
57
-
58
- # Copyright and License
59
-
60
- The MIT License (MIT)
61
-
62
- Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
63
-
64
-
65
- [pykit3]: https://github.com/pykit3
66
- Keywords: thread
67
- Platform: UNKNOWN
68
- Classifier: Development Status :: 4 - Beta
69
- Classifier: Intended Audience :: Developers
70
- Classifier: Topic :: Software Development :: Libraries
71
- Classifier: Programming Language :: Python :: 3.6
72
- Classifier: Programming Language :: Python :: 3.7
73
- Classifier: Programming Language :: Python :: 3.8
74
- Classifier: Programming Language :: Python :: Implementation :: PyPy
75
- Requires-Python: >=3.0
76
- Description-Content-Type: text/markdown
@@ -1,23 +0,0 @@
1
- # DO NOT EDIT!!! built with `python _building/build_setup.py`
2
- import setuptools
3
- setuptools.setup(
4
- name="k3thread",
5
- packages=["k3thread"],
6
- version="0.1.3",
7
- license='MIT',
8
- description='utility to create thread.',
9
- long_description='# k3thread\n\n[![Build Status](https://travis-ci.com/pykit3/k3thread.svg?branch=master)](https://travis-ci.com/pykit3/k3thread)\n![Python package](https://github.com/pykit3/k3thread/workflows/Python%20package/badge.svg)\n[![Documentation Status](https://readthedocs.org/projects/k3thread/badge/?version=stable)](https://k3thread.readthedocs.io/en/stable/?badge=stable)\n[![Package](https://img.shields.io/pypi/pyversions/k3thread)](https://pypi.org/project/k3thread)\n\nutility to create thread.\n\nk3thread is a component of [pykit3] project: a python3 toolkit set.\n\n\nk3thread is utility to create and operate thread.\n\nStart a daemon thread after 0.2 seconds::\n\n >>> th = daemon(lambda :1, after=0.2)\n\nStop a thread by sending a exception::\n\n import time\n\n def busy():\n while True:\n time.sleep(0.1)\n\n t = daemon(busy)\n send_exception(t, SystemExit)\n\n\n\n\n# Install\n\n```\npip install k3thread\n```\n\n# Synopsis\n\n```python\n>>> th = daemon(lambda :1, after=0.2)\n\n```\n\n# Author\n\nZhang Yanpo (张炎泼) <drdr.xp@gmail.com>\n\n# Copyright and License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>\n\n\n[pykit3]: https://github.com/pykit3',
10
- long_description_content_type="text/markdown",
11
- author='Zhang Yanpo',
12
- author_email='drdr.xp@gmail.com',
13
- url='https://github.com/pykit3/k3thread',
14
- keywords=['thread'],
15
- python_requires='>=3.0',
16
-
17
- install_requires=['k3ut>=0.1.15,<0.2'],
18
- classifiers=[
19
- 'Development Status :: 4 - Beta',
20
- 'Intended Audience :: Developers',
21
- 'Topic :: Software Development :: Libraries',
22
- ] + ['Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: PyPy'],
23
- )
@@ -1,76 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: k3thread
3
- Version: 0.1.3
4
- Summary: utility to create thread.
5
- Home-page: https://github.com/pykit3/k3thread
6
- Author: Zhang Yanpo
7
- Author-email: drdr.xp@gmail.com
8
- License: MIT
9
- Description: # k3thread
10
-
11
- [![Build Status](https://travis-ci.com/pykit3/k3thread.svg?branch=master)](https://travis-ci.com/pykit3/k3thread)
12
- ![Python package](https://github.com/pykit3/k3thread/workflows/Python%20package/badge.svg)
13
- [![Documentation Status](https://readthedocs.org/projects/k3thread/badge/?version=stable)](https://k3thread.readthedocs.io/en/stable/?badge=stable)
14
- [![Package](https://img.shields.io/pypi/pyversions/k3thread)](https://pypi.org/project/k3thread)
15
-
16
- utility to create thread.
17
-
18
- k3thread is a component of [pykit3] project: a python3 toolkit set.
19
-
20
-
21
- k3thread is utility to create and operate thread.
22
-
23
- Start a daemon thread after 0.2 seconds::
24
-
25
- >>> th = daemon(lambda :1, after=0.2)
26
-
27
- Stop a thread by sending a exception::
28
-
29
- import time
30
-
31
- def busy():
32
- while True:
33
- time.sleep(0.1)
34
-
35
- t = daemon(busy)
36
- send_exception(t, SystemExit)
37
-
38
-
39
-
40
-
41
- # Install
42
-
43
- ```
44
- pip install k3thread
45
- ```
46
-
47
- # Synopsis
48
-
49
- ```python
50
- >>> th = daemon(lambda :1, after=0.2)
51
-
52
- ```
53
-
54
- # Author
55
-
56
- Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
57
-
58
- # Copyright and License
59
-
60
- The MIT License (MIT)
61
-
62
- Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
63
-
64
-
65
- [pykit3]: https://github.com/pykit3
66
- Keywords: thread
67
- Platform: UNKNOWN
68
- Classifier: Development Status :: 4 - Beta
69
- Classifier: Intended Audience :: Developers
70
- Classifier: Topic :: Software Development :: Libraries
71
- Classifier: Programming Language :: Python :: 3.6
72
- Classifier: Programming Language :: Python :: 3.7
73
- Classifier: Programming Language :: Python :: 3.8
74
- Classifier: Programming Language :: Python :: Implementation :: PyPy
75
- Requires-Python: >=3.0
76
- Description-Content-Type: text/markdown
@@ -1,9 +0,0 @@
1
- setup.py
2
- k3thread/__init__.py
3
- k3thread/setup.py
4
- k3thread/thd.py
5
- k3thread.egg-info/PKG-INFO
6
- k3thread.egg-info/SOURCES.txt
7
- k3thread.egg-info/dependency_links.txt
8
- k3thread.egg-info/requires.txt
9
- k3thread.egg-info/top_level.txt
@@ -1 +0,0 @@
1
- k3ut<0.2,>=0.1.15
k3thread-0.1.3/setup.py DELETED
@@ -1,23 +0,0 @@
1
- # DO NOT EDIT!!! built with `python _building/build_setup.py`
2
- import setuptools
3
- setuptools.setup(
4
- name="k3thread",
5
- packages=["k3thread"],
6
- version="0.1.3",
7
- license='MIT',
8
- description='utility to create thread.',
9
- long_description='# k3thread\n\n[![Build Status](https://travis-ci.com/pykit3/k3thread.svg?branch=master)](https://travis-ci.com/pykit3/k3thread)\n![Python package](https://github.com/pykit3/k3thread/workflows/Python%20package/badge.svg)\n[![Documentation Status](https://readthedocs.org/projects/k3thread/badge/?version=stable)](https://k3thread.readthedocs.io/en/stable/?badge=stable)\n[![Package](https://img.shields.io/pypi/pyversions/k3thread)](https://pypi.org/project/k3thread)\n\nutility to create thread.\n\nk3thread is a component of [pykit3] project: a python3 toolkit set.\n\n\nk3thread is utility to create and operate thread.\n\nStart a daemon thread after 0.2 seconds::\n\n >>> th = daemon(lambda :1, after=0.2)\n\nStop a thread by sending a exception::\n\n import time\n\n def busy():\n while True:\n time.sleep(0.1)\n\n t = daemon(busy)\n send_exception(t, SystemExit)\n\n\n\n\n# Install\n\n```\npip install k3thread\n```\n\n# Synopsis\n\n```python\n>>> th = daemon(lambda :1, after=0.2)\n\n```\n\n# Author\n\nZhang Yanpo (张炎泼) <drdr.xp@gmail.com>\n\n# Copyright and License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>\n\n\n[pykit3]: https://github.com/pykit3',
10
- long_description_content_type="text/markdown",
11
- author='Zhang Yanpo',
12
- author_email='drdr.xp@gmail.com',
13
- url='https://github.com/pykit3/k3thread',
14
- keywords=['thread'],
15
- python_requires='>=3.0',
16
-
17
- install_requires=['k3ut>=0.1.15,<0.2'],
18
- classifiers=[
19
- 'Development Status :: 4 - Beta',
20
- 'Intended Audience :: Developers',
21
- 'Topic :: Software Development :: Libraries',
22
- ] + ['Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: PyPy'],
23
- )
File without changes