device-proxy-factory 0.2.0__py3-none-any.whl
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.
- device_proxy_factory/__init__.py +13 -0
- device_proxy_factory/core.py +48 -0
- device_proxy_factory/core.pyi +16 -0
- device_proxy_factory/factories.py +28 -0
- device_proxy_factory/py.typed +0 -0
- device_proxy_factory/typing_generator.py +104 -0
- device_proxy_factory-0.2.0.dist-info/METADATA +122 -0
- device_proxy_factory-0.2.0.dist-info/RECORD +11 -0
- device_proxy_factory-0.2.0.dist-info/WHEEL +5 -0
- device_proxy_factory-0.2.0.dist-info/licenses/LICENSE +201 -0
- device_proxy_factory-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""デバイスクラス名に基づく共通クライアントファクトリ。"""
|
|
2
|
+
from .core import (
|
|
3
|
+
DeviceProxy, DeviceProxyEntry, create_device_proxy,
|
|
4
|
+
get_device_proxy_entry, list_device_proxies,
|
|
5
|
+
register_device_proxy, unregister_device_proxy,
|
|
6
|
+
)
|
|
7
|
+
from .factories import make_async_sync_factory
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"DeviceProxy", "DeviceProxyEntry", "create_device_proxy",
|
|
11
|
+
"get_device_proxy_entry", "list_device_proxies",
|
|
12
|
+
"register_device_proxy", "unregister_device_proxy", "make_async_sync_factory",
|
|
13
|
+
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""通信方式に依存しない、デバイスクラス名からのクライアント生成ファクトリ。"""
|
|
2
|
+
from typing import Any, Callable, Dict, List, NamedTuple
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class DeviceProxyEntry(NamedTuple):
|
|
6
|
+
device_class: str
|
|
7
|
+
creator: Callable[..., Any]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
_REGISTRY: Dict[str, DeviceProxyEntry] = {}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def register_device_proxy(device_class: str, creator: Callable[..., Any]) -> None:
|
|
14
|
+
"""クラス名と生成処理を登録する。同名の再登録は許可しない。"""
|
|
15
|
+
if not isinstance(device_class, str) or not device_class.strip() or device_class != device_class.strip():
|
|
16
|
+
raise ValueError("device_class must be a nonempty, trimmed string")
|
|
17
|
+
if not callable(creator):
|
|
18
|
+
raise TypeError("creator must be callable")
|
|
19
|
+
if device_class in _REGISTRY:
|
|
20
|
+
raise ValueError("device class already registered: {}".format(device_class))
|
|
21
|
+
_REGISTRY[device_class] = DeviceProxyEntry(device_class, creator)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def unregister_device_proxy(device_class: str) -> None:
|
|
25
|
+
"""登録を解除する。未登録の場合は KeyError。"""
|
|
26
|
+
del _REGISTRY[device_class]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_device_proxy_entry(device_class: str) -> DeviceProxyEntry:
|
|
30
|
+
"""登録情報を取得する。未登録の場合は KeyError。"""
|
|
31
|
+
return _REGISTRY[device_class]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def list_device_proxies() -> List[str]:
|
|
35
|
+
"""登録済みのデバイスクラス名を辞書順で返す。"""
|
|
36
|
+
return sorted(_REGISTRY)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def DeviceProxy(device_class: str, *args: Any, **kwargs: Any) -> Any:
|
|
40
|
+
"""登録済み creator を呼び出す。引数は一切解釈せず転送する。"""
|
|
41
|
+
return get_device_proxy_entry(device_class).creator(*args, **kwargs)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def create_device_proxy(device_class: str) -> Callable[..., Any]:
|
|
45
|
+
"""デバイスクラス名を固定したローカルファクトリを返す。"""
|
|
46
|
+
def proxy(*args: Any, **kwargs: Any) -> Any:
|
|
47
|
+
return DeviceProxy(device_class, *args, **kwargs)
|
|
48
|
+
return proxy
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""生成ファイル。専用クライアント型は各デバイスパッケージの .pyi に従う。"""
|
|
2
|
+
from typing import Any, Callable, List, NamedTuple, Dict
|
|
3
|
+
from typing_extensions import Literal, overload
|
|
4
|
+
|
|
5
|
+
class DeviceProxyEntry(NamedTuple):
|
|
6
|
+
device_class: str
|
|
7
|
+
creator: Callable[..., Any]
|
|
8
|
+
|
|
9
|
+
def register_device_proxy(device_class: str, creator: Callable[..., Any]) -> None: ...
|
|
10
|
+
def unregister_device_proxy(device_class: str) -> None: ...
|
|
11
|
+
def get_device_proxy_entry(device_class: str) -> DeviceProxyEntry: ...
|
|
12
|
+
def list_device_proxies() -> List[str]: ...
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def DeviceProxy(device_class: str, *args: Any, **kwargs: Any) -> Any: ...
|
|
16
|
+
def create_device_proxy(device_class: str) -> Callable[..., Any]: ...
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""HTTP/gRPC の既存同期・非同期クライアント対に使える補助ファクトリ。"""
|
|
2
|
+
from typing import Any, Callable, Optional, Type
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def make_async_sync_factory(
|
|
6
|
+
*,
|
|
7
|
+
async_client_cls: Optional[Type[Any]] = None,
|
|
8
|
+
sync_client_cls: Optional[Type[Any]] = None,
|
|
9
|
+
default_async_mode: bool = True,
|
|
10
|
+
) -> Callable[..., Any]:
|
|
11
|
+
"""async_mode を解釈する creator を作成する。共通 DeviceProxy は解釈しない。"""
|
|
12
|
+
if async_client_cls is None and sync_client_cls is None:
|
|
13
|
+
raise ValueError("at least one client class is required")
|
|
14
|
+
if async_client_cls is not None and not callable(async_client_cls):
|
|
15
|
+
raise TypeError("async_client_cls must be callable")
|
|
16
|
+
if sync_client_cls is not None and not callable(sync_client_cls):
|
|
17
|
+
raise TypeError("sync_client_cls must be callable")
|
|
18
|
+
|
|
19
|
+
def creator(*args: Any, async_mode: Optional[bool] = None, **kwargs: Any) -> Any:
|
|
20
|
+
selected = default_async_mode if async_mode is None else async_mode
|
|
21
|
+
if not isinstance(selected, bool):
|
|
22
|
+
raise TypeError("async_mode must be bool or None")
|
|
23
|
+
cls = async_client_cls if selected else sync_client_cls
|
|
24
|
+
if cls is None:
|
|
25
|
+
raise ValueError("{} client is not registered".format("async" if selected else "sync"))
|
|
26
|
+
return cls(*args, **kwargs)
|
|
27
|
+
|
|
28
|
+
return creator
|
|
File without changes
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"""明示的なデバイス型対応表から共通 DeviceProxy のスタブを生成する。
|
|
2
|
+
|
|
3
|
+
実行時レジストリや通信フレームワークには依存しない。
|
|
4
|
+
"""
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import keyword
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _identifier(value):
|
|
12
|
+
return isinstance(value, str) and value.isidentifier() and not keyword.iskeyword(value)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _qualified_class(value):
|
|
16
|
+
if not isinstance(value, str) or "." not in value:
|
|
17
|
+
raise ValueError("クライアント型は 'package.module.ClassName' 形式で指定してください")
|
|
18
|
+
module, cls = value.rsplit(".", 1)
|
|
19
|
+
if not all(_identifier(part) for part in module.split(".")) or not _identifier(cls):
|
|
20
|
+
raise ValueError("クライアント型のモジュール名またはクラス名が不正です: " + value)
|
|
21
|
+
return module, cls
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def generate_device_proxy_pyi(devices, output):
|
|
25
|
+
"""デバイス名→専用クライアント型の対応を含む core.pyi を生成する。
|
|
26
|
+
|
|
27
|
+
devices は明示的な辞書の配列。専用クライアントの .pyi はコピーしない。
|
|
28
|
+
"""
|
|
29
|
+
if not isinstance(devices, list):
|
|
30
|
+
raise ValueError("devices は配列で指定してください")
|
|
31
|
+
names = set()
|
|
32
|
+
imports = []
|
|
33
|
+
definitions = []
|
|
34
|
+
for device in devices:
|
|
35
|
+
if not isinstance(device, dict):
|
|
36
|
+
raise ValueError("各デバイスは辞書で指定してください")
|
|
37
|
+
name = device.get("device_class")
|
|
38
|
+
if not isinstance(name, str) or not name.strip() or name != name.strip() or name in names:
|
|
39
|
+
raise ValueError("デバイスクラス名が不正または重複しています: {!r}".format(name))
|
|
40
|
+
names.add(name)
|
|
41
|
+
single = device.get("client")
|
|
42
|
+
async_cls = device.get("async_client")
|
|
43
|
+
sync_cls = device.get("sync_client")
|
|
44
|
+
if (single is None) == (async_cls is None and sync_cls is None):
|
|
45
|
+
raise ValueError("{}: client または async_client/sync_client を指定してください".format(name))
|
|
46
|
+
key = repr(name)
|
|
47
|
+
if single is not None:
|
|
48
|
+
module, cls = _qualified_class(single)
|
|
49
|
+
alias = "_Client_{}".format(len(imports))
|
|
50
|
+
imports.append("from {} import {} as {}".format(module, cls, alias))
|
|
51
|
+
definitions.append("@overload\ndef DeviceProxy(device_class: Literal[{}], *args: Any, **kwargs: Any) -> {}: ...".format(key, alias))
|
|
52
|
+
else:
|
|
53
|
+
default = device.get("default_async_mode", True)
|
|
54
|
+
if not isinstance(default, bool):
|
|
55
|
+
raise ValueError("default_async_mode は bool で指定してください")
|
|
56
|
+
aliases = {}
|
|
57
|
+
for mode, qualified in ((True, async_cls), (False, sync_cls)):
|
|
58
|
+
if qualified is None:
|
|
59
|
+
continue
|
|
60
|
+
module, cls = _qualified_class(qualified)
|
|
61
|
+
alias = "_Client_{}".format(len(imports))
|
|
62
|
+
imports.append("from {} import {} as {}".format(module, cls, alias))
|
|
63
|
+
aliases[mode] = alias
|
|
64
|
+
definitions.append("@overload\ndef DeviceProxy(device_class: Literal[{}], *args: Any, async_mode: Literal[{}], **kwargs: Any) -> {}: ...".format(key, mode, alias))
|
|
65
|
+
if default in aliases:
|
|
66
|
+
definitions.append("@overload\ndef DeviceProxy(device_class: Literal[{}], *args: Any, async_mode: None = None, **kwargs: Any) -> {}: ...".format(key, aliases[default]))
|
|
67
|
+
lines = [
|
|
68
|
+
'"""生成ファイル。専用クライアント型は各デバイスパッケージの .pyi に従う。"""',
|
|
69
|
+
"from typing import Any, Callable, List, NamedTuple, Dict",
|
|
70
|
+
"from typing_extensions import Literal, overload",
|
|
71
|
+
*imports,
|
|
72
|
+
"",
|
|
73
|
+
"class DeviceProxyEntry(NamedTuple):",
|
|
74
|
+
" device_class: str",
|
|
75
|
+
" creator: Callable[..., Any]",
|
|
76
|
+
"",
|
|
77
|
+
"def register_device_proxy(device_class: str, creator: Callable[..., Any]) -> None: ...",
|
|
78
|
+
"def unregister_device_proxy(device_class: str) -> None: ...",
|
|
79
|
+
"def get_device_proxy_entry(device_class: str) -> DeviceProxyEntry: ...",
|
|
80
|
+
"def list_device_proxies() -> List[str]: ...",
|
|
81
|
+
"",
|
|
82
|
+
*definitions,
|
|
83
|
+
"@overload" if definitions else "",
|
|
84
|
+
"def DeviceProxy(device_class: str, *args: Any, **kwargs: Any) -> Any: ...",
|
|
85
|
+
"def create_device_proxy(device_class: str) -> Callable[..., Any]: ...",
|
|
86
|
+
"",
|
|
87
|
+
]
|
|
88
|
+
path = Path(output)
|
|
89
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
90
|
+
path.write_text("\n".join(lines), encoding="utf-8")
|
|
91
|
+
return path
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def main():
|
|
95
|
+
parser = argparse.ArgumentParser(description="共通 DeviceProxy の型定義を生成")
|
|
96
|
+
parser.add_argument("manifest", help="明示的なデバイス型対応 JSON")
|
|
97
|
+
parser.add_argument("output", help="生成先 core.pyi")
|
|
98
|
+
args = parser.parse_args()
|
|
99
|
+
data = json.loads(Path(args.manifest).read_text(encoding="utf-8"))
|
|
100
|
+
generate_device_proxy_pyi(data["devices"], args.output)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
if __name__ == "__main__":
|
|
104
|
+
main()
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: device-proxy-factory
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Transport-independent device client factory registry
|
|
5
|
+
Author: Ohara Lab
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Requires-Python: >=3.7
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: typing_extensions>=4.0
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# device-proxy-factory
|
|
14
|
+
|
|
15
|
+
[](README.md)
|
|
16
|
+
[](README.ja.md)
|
|
17
|
+
|
|
18
|
+
[](https://github.com/ohara-lab-su/device_proxy_factory/)
|
|
19
|
+
[](https://ohara-lab-su.github.io/device_proxy_factory/ja/)
|
|
20
|
+
[](https://ohara-lab-su.github.io/index.html)
|
|
21
|
+
|
|
22
|
+
A small Python package that maps unique device-class names to callable client factories. It does **not** abstract HTTP
|
|
23
|
+
(`ese774_frame`), gRPC (`grpc_frame`), or Tango (`tango_frame`) transport. Its purpose is to instantiate device-specific
|
|
24
|
+
clients through one common `DeviceProxy`.
|
|
25
|
+
|
|
26
|
+
**Status:** 0.2.0 prototype. No existing framework has been modified; the distribution name is provisional. No hardware
|
|
27
|
+
integration tests have been performed.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Run `python -m pip install .` from the project root, or `python -m pip install -e .` for development. Requires Python
|
|
32
|
+
3.7+. Transport frameworks and device packages must be installed separately as needed. Installing this package does
|
|
33
|
+
**not** discover or register device packages automatically.
|
|
34
|
+
|
|
35
|
+
## Contract
|
|
36
|
+
|
|
37
|
+
- Registry key: unique device-class name; duplicate registration raises `ValueError`.
|
|
38
|
+
- Registry value: callable `creator`, including a client class directly.
|
|
39
|
+
- `DeviceProxy(device_class, *args, **kwargs)` forwards arguments unchanged to `creator` and does not interpret
|
|
40
|
+
`async_mode`, `config`, `api_spec`, or transport.
|
|
41
|
+
- Optional `make_async_sync_factory` handles an async/sync client pair and interprets `async_mode` inside that factory.
|
|
42
|
+
- No discovery, entry points, database, or protocol selector.
|
|
43
|
+
- Single-device users may instantiate a client directly, use a package-local proxy, or use this common proxy.
|
|
44
|
+
|
|
45
|
+
## Device package registration
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from device_proxy_factory import register_device_proxy, make_async_sync_factory
|
|
49
|
+
from .clients import AsyncCobottaClient, SyncCobottaClient
|
|
50
|
+
|
|
51
|
+
register_device_proxy("CobottaCtrl", make_async_sync_factory(
|
|
52
|
+
async_client_cls=AsyncCobottaClient,
|
|
53
|
+
sync_client_cls=SyncCobottaClient,
|
|
54
|
+
default_async_mode=True,
|
|
55
|
+
))
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The import path `.clients` above is illustrative; use the actual device-package layout. For Tango-style packages with
|
|
59
|
+
one dedicated client:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from device_proxy_factory import register_device_proxy
|
|
63
|
+
from .device_client import DeviceClient
|
|
64
|
+
|
|
65
|
+
register_device_proxy("TangoDevice", DeviceClient)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Registration can occur during an explicit module import or via an explicit initialization function. Re-registering a
|
|
69
|
+
class name in the same process raises an error.
|
|
70
|
+
|
|
71
|
+
## Client use
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from device_proxy_factory import DeviceProxy
|
|
75
|
+
import cobotta_device # illustrative package name; registers CobottaCtrl
|
|
76
|
+
import tango_device # illustrative package name; registers TangoDevice
|
|
77
|
+
|
|
78
|
+
cobotta = DeviceProxy("CobottaCtrl", server_ip="127.0.0.1", async_mode=False)
|
|
79
|
+
tango = DeviceProxy("TangoDevice", "tango://127.0.0.1:10000/test/tango/device#dbase=no")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Use the real import paths and constructor arguments of your device packages. `async_mode` is only valid for creators
|
|
83
|
+
that support it.
|
|
84
|
+
|
|
85
|
+
## Public API and testing
|
|
86
|
+
|
|
87
|
+
`DeviceProxy`, `DeviceProxyEntry`, `register_device_proxy`, `unregister_device_proxy`, `get_device_proxy_entry`,
|
|
88
|
+
`list_device_proxies`, `create_device_proxy`, `make_async_sync_factory`.
|
|
89
|
+
|
|
90
|
+
Install `pytest` and run `python -m pytest -q`. The tests do not require hardware.
|
|
91
|
+
|
|
92
|
+
## Documentation and limitations
|
|
93
|
+
|
|
94
|
+
Japanese Pages sources: `docs/ja/`; English: `docs/en/`. Build with `bash docs/build.sh` using Sphinx, MyST Parser, and
|
|
95
|
+
sphinx-rtd-theme. GitHub Pages uses `.github/workflows/pages.yml` and publishes the root (English), `/en/`, and `/ja/`.
|
|
96
|
+
|
|
97
|
+
Existing `ese774_frame` and `grpc_frame` proxies have their **own** registries. Installing this package does not merge
|
|
98
|
+
them. Device packages must explicitly register into the common registry; device-specific `.pyi` files are reused through
|
|
99
|
+
explicitly generated common overload declarations; integration with real device packages and static type-checker
|
|
100
|
+
validation remain outstanding. See `docs/en/limitations.md`.
|
|
101
|
+
|
|
102
|
+
License: Apache-2.0 (prototype; confirm organizational publication requirements before release).
|
|
103
|
+
|
|
104
|
+
## Reusing device-specific client `.pyi` (0.2.0)
|
|
105
|
+
|
|
106
|
+
**Each device package's dedicated client stub is authoritative**, including client-side method additions and overrides.
|
|
107
|
+
The shared `DeviceProxy` stub only maps a device-class name to that dedicated client type; it does not copy client API
|
|
108
|
+
declarations or use generic base-client stubs.
|
|
109
|
+
|
|
110
|
+
Create `examples/device-types.json` containing actual fully qualified dedicated client class names, using
|
|
111
|
+
`examples/device-types.example.json` as a format reference, then run:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
python -m device_proxy_factory.typing_generator \
|
|
115
|
+
examples/device-types.json src/device_proxy_factory/core.pyi
|
|
116
|
+
python -m pip install -e .
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
This explicitly regenerates the shared package's `core.pyi`. Device packages must be installed for static type
|
|
120
|
+
resolution. Runtime registration remains separate. Adding a device does **not** automatically update an installed shared
|
|
121
|
+
stub. Read the normative AI-oriented engineering contract in [`AGENTS.md`](AGENTS.md) and the English Pages document [
|
|
122
|
+
`docs/en/agent-contract.md`](docs/en/agent-contract.md).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
device_proxy_factory/__init__.py,sha256=drVJ6TTtdw5ndY6bDQm2of9EQIEXPBBoL7gpxzMuB3U,524
|
|
2
|
+
device_proxy_factory/core.py,sha256=iPPtrBgkb3-Ncmtg4Z7HF6VLEmRZnE2VvSRvRiG0NZY,1946
|
|
3
|
+
device_proxy_factory/core.pyi,sha256=dXW81lun1W6nUC3kQTWJfSNazgdxcxtm-939Nsfh-wY,714
|
|
4
|
+
device_proxy_factory/factories.py,sha256=Z0O0ABHwtriKilM8uM4vc2zCQVdRBm_1xIG2-tRq1DM,1356
|
|
5
|
+
device_proxy_factory/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
device_proxy_factory/typing_generator.py,sha256=Q7Y0G3u3cNgIYG51nT3PKqORXvy7pVLEweaGOc28i2s,5015
|
|
7
|
+
device_proxy_factory-0.2.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
8
|
+
device_proxy_factory-0.2.0.dist-info/METADATA,sha256=sBQZ6mntn2EEW-n0jyxALj2KVPSkuS64Wkg38e-TNFo,5857
|
|
9
|
+
device_proxy_factory-0.2.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
10
|
+
device_proxy_factory-0.2.0.dist-info/top_level.txt,sha256=uyqHoWL3iGGAfL0gA-aJkWIaFLSoHcSQxM01KPJjhc4,21
|
|
11
|
+
device_proxy_factory-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
device_proxy_factory
|