summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-03-09 17:46:49 +0000
committerCoprDistGit <infra@openeuler.org>2023-03-09 17:46:49 +0000
commit44f241d38e67e526ac30875ec7fca94343ff07d4 (patch)
tree76e4ad5de8681c63c4da5dadf7cf5dbdd83fe7f5
parent8fffa06778e3acff356513a65325e0a19b9c1144 (diff)
automatic import of python-upnpy
-rw-r--r--.gitignore1
-rw-r--r--python-upnpy.spec606
-rw-r--r--sources1
3 files changed, 608 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..6287210 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/UPnPy-1.1.8.tar.gz
diff --git a/python-upnpy.spec b/python-upnpy.spec
new file mode 100644
index 0000000..07a844a
--- /dev/null
+++ b/python-upnpy.spec
@@ -0,0 +1,606 @@
+%global _empty_manifest_terminate_build 0
+Name: python-UPnPy
+Version: 1.1.8
+Release: 1
+Summary: Lightweight UPnP client library for Python.
+License: MIT
+URL: https://github.com/5kyc0d3r/upnpy
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/80/66/d4e721ff8766ea3e78730574669f6feeb71e438a8c2d7a62b2c3456a5c12/UPnPy-1.1.8.tar.gz
+BuildArch: noarch
+
+
+%description
+# UPnPy
+[![Build Status](https://travis-ci.org/5kyc0d3r/upnpy.svg?branch=master)](https://travis-ci.org/5kyc0d3r/upnpy)
+[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/upnpy.svg)](https://pypi.org/project/UPnPy/)
+[![PyPI package version](https://img.shields.io/pypi/v/upnpy.svg)](https://pypi.org/project/UPnPy/)
+[![MIT License](https://img.shields.io/badge/license-MIT-red.svg)](https://github.com/5kyc0d3r/upnpy/blob/master/LICENSE)
+
+Lightweight UPnP client library for Python.
+
+## Install
+```
+$ pip install upnpy
+```
+
+## Examples
+
+#### Get the external IP address of an [Internet Gateway Device](https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol):
+```python
+import upnpy
+
+upnp = upnpy.UPnP()
+
+# Discover UPnP devices on the network
+# Returns a list of devices e.g.: [Device <Broadcom ADSL Router>]
+devices = upnp.discover()
+
+# Select the IGD
+# alternatively you can select the device directly from the list
+# device = devices[0]
+device = upnp.get_igd()
+
+# Get the services available for this device
+# Returns a list of services available for the device
+# e.g.: [<Service (WANPPPConnection) id="WANPPPConnection.1">, ...]
+device.get_services()
+
+# We can now access a specific service on the device by its ID
+# The IDs for the services in this case contain illegal values so we can't access it by an attribute
+# If the service ID didn't contain illegal values we could access it via an attribute like this:
+# service = device.WANPPPConnection
+
+# We will access it like a dictionary instead:
+service = device['WANPPPConnection.1']
+
+# Get the actions available for the service
+# Returns a list of actions for the service:
+# [<Action name="SetConnectionType">,
+# <Action name="GetConnectionTypeInfo">,
+# <Action name="RequestConnection">,
+# <Action name="ForceTermination">,
+# <Action name="GetStatusInfo">,
+# <Action name="GetNATRSIPStatus">,
+# <Action name="GetGenericPortMappingEntry">,
+# <Action name="GetSpecificPortMappingEntry">,
+# <Action name="AddPortMapping">,
+# <Action name="DeletePortMapping">,
+# <Action name="GetExternalIPAddress">]
+service.get_actions()
+
+# Finally, get the external IP address
+# Execute the action by its name
+# Returns a dictionary: {'NewExternalIPAddress': 'xxx.xxx.xxx.xxx'}
+service.GetExternalIPAddress()
+```
+
+#### Add a new port mapping to an [Internet Gateway Device](https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol):
+```python
+import upnpy
+
+upnp = upnpy.UPnP()
+
+# Discover UPnP devices on the network
+# Returns a list of devices e.g.: [Device <Broadcom ADSL Router>]
+devices = upnp.discover()
+
+# Select the IGD
+# alternatively you can select the device directly from the list
+# device = devices[0]
+device = upnp.get_igd()
+
+# Get the services available for this device
+# Returns a list of services available for the device
+# e.g.: [<Service (WANPPPConnection) id="WANPPPConnection.1">, ...]
+device.get_services()
+
+# We can now access a specific service on the device by its ID
+# The IDs for the services in this case contain illegal values so we can't access it by an attribute
+# If the service ID didn't contain illegal values we could access it via an attribute like this:
+# service = device.WANPPPConnection
+
+# We will access it like a dictionary instead:
+service = device['WANPPPConnection.1']
+
+# Get the actions available for the service
+# Returns a list of actions for the service:
+# [<Action name="SetConnectionType">,
+# <Action name="GetConnectionTypeInfo">,
+# <Action name="RequestConnection">,
+# <Action name="ForceTermination">,
+# <Action name="GetStatusInfo">,
+# <Action name="GetNATRSIPStatus">,
+# <Action name="GetGenericPortMappingEntry">,
+# <Action name="GetSpecificPortMappingEntry">,
+# <Action name="AddPortMapping">,
+# <Action name="DeletePortMapping">,
+# <Action name="GetExternalIPAddress">]
+service.get_actions()
+
+# The action we are looking for is the "AddPortMapping" action
+# Lets see what arguments the action accepts
+# Use the get_input_arguments() or get_output_arguments() method of the action
+# for a list of input / output arguments.
+# Example output of the get_input_arguments method for the "AddPortMapping" action
+# Returns a dictionary:
+# [
+# {
+# "name": "NewRemoteHost",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewExternalPort",
+# "data_type": "ui2",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewProtocol",
+# "data_type": "string",
+# "allowed_value_list": [
+# "TCP",
+# "UDP"
+# ]
+# },
+# {
+# "name": "NewInternalPort",
+# "data_type": "ui2",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewInternalClient",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewEnabled",
+# "data_type": "boolean",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewPortMappingDescription",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewLeaseDuration",
+# "data_type": "ui4",
+# "allowed_value_list": []
+# }
+# ]
+service.AddPortMapping.get_input_arguments()
+
+# Finally, add the new port mapping to the IGD
+# This specific action returns an empty dict: {}
+service.AddPortMapping(
+ NewRemoteHost='',
+ NewExternalPort=80,
+ NewProtocol='TCP',
+ NewInternalPort=8000,
+ NewInternalClient='192.168.1.3',
+ NewEnabled=1,
+ NewPortMappingDescription='Test port mapping entry from UPnPy.',
+ NewLeaseDuration=0
+)
+```
+
+## Documentation
+Documentation is available at [https://upnpy.readthedocs.io/en/latest/](https://upnpy.readthedocs.io/en/latest/)
+
+## License
+This project is licensed under the terms of the [MIT License](https://github.com/5kyc0d3r/upnpy/blob/master/LICENSE).
+
+%package -n python3-UPnPy
+Summary: Lightweight UPnP client library for Python.
+Provides: python-UPnPy
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-UPnPy
+# UPnPy
+[![Build Status](https://travis-ci.org/5kyc0d3r/upnpy.svg?branch=master)](https://travis-ci.org/5kyc0d3r/upnpy)
+[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/upnpy.svg)](https://pypi.org/project/UPnPy/)
+[![PyPI package version](https://img.shields.io/pypi/v/upnpy.svg)](https://pypi.org/project/UPnPy/)
+[![MIT License](https://img.shields.io/badge/license-MIT-red.svg)](https://github.com/5kyc0d3r/upnpy/blob/master/LICENSE)
+
+Lightweight UPnP client library for Python.
+
+## Install
+```
+$ pip install upnpy
+```
+
+## Examples
+
+#### Get the external IP address of an [Internet Gateway Device](https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol):
+```python
+import upnpy
+
+upnp = upnpy.UPnP()
+
+# Discover UPnP devices on the network
+# Returns a list of devices e.g.: [Device <Broadcom ADSL Router>]
+devices = upnp.discover()
+
+# Select the IGD
+# alternatively you can select the device directly from the list
+# device = devices[0]
+device = upnp.get_igd()
+
+# Get the services available for this device
+# Returns a list of services available for the device
+# e.g.: [<Service (WANPPPConnection) id="WANPPPConnection.1">, ...]
+device.get_services()
+
+# We can now access a specific service on the device by its ID
+# The IDs for the services in this case contain illegal values so we can't access it by an attribute
+# If the service ID didn't contain illegal values we could access it via an attribute like this:
+# service = device.WANPPPConnection
+
+# We will access it like a dictionary instead:
+service = device['WANPPPConnection.1']
+
+# Get the actions available for the service
+# Returns a list of actions for the service:
+# [<Action name="SetConnectionType">,
+# <Action name="GetConnectionTypeInfo">,
+# <Action name="RequestConnection">,
+# <Action name="ForceTermination">,
+# <Action name="GetStatusInfo">,
+# <Action name="GetNATRSIPStatus">,
+# <Action name="GetGenericPortMappingEntry">,
+# <Action name="GetSpecificPortMappingEntry">,
+# <Action name="AddPortMapping">,
+# <Action name="DeletePortMapping">,
+# <Action name="GetExternalIPAddress">]
+service.get_actions()
+
+# Finally, get the external IP address
+# Execute the action by its name
+# Returns a dictionary: {'NewExternalIPAddress': 'xxx.xxx.xxx.xxx'}
+service.GetExternalIPAddress()
+```
+
+#### Add a new port mapping to an [Internet Gateway Device](https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol):
+```python
+import upnpy
+
+upnp = upnpy.UPnP()
+
+# Discover UPnP devices on the network
+# Returns a list of devices e.g.: [Device <Broadcom ADSL Router>]
+devices = upnp.discover()
+
+# Select the IGD
+# alternatively you can select the device directly from the list
+# device = devices[0]
+device = upnp.get_igd()
+
+# Get the services available for this device
+# Returns a list of services available for the device
+# e.g.: [<Service (WANPPPConnection) id="WANPPPConnection.1">, ...]
+device.get_services()
+
+# We can now access a specific service on the device by its ID
+# The IDs for the services in this case contain illegal values so we can't access it by an attribute
+# If the service ID didn't contain illegal values we could access it via an attribute like this:
+# service = device.WANPPPConnection
+
+# We will access it like a dictionary instead:
+service = device['WANPPPConnection.1']
+
+# Get the actions available for the service
+# Returns a list of actions for the service:
+# [<Action name="SetConnectionType">,
+# <Action name="GetConnectionTypeInfo">,
+# <Action name="RequestConnection">,
+# <Action name="ForceTermination">,
+# <Action name="GetStatusInfo">,
+# <Action name="GetNATRSIPStatus">,
+# <Action name="GetGenericPortMappingEntry">,
+# <Action name="GetSpecificPortMappingEntry">,
+# <Action name="AddPortMapping">,
+# <Action name="DeletePortMapping">,
+# <Action name="GetExternalIPAddress">]
+service.get_actions()
+
+# The action we are looking for is the "AddPortMapping" action
+# Lets see what arguments the action accepts
+# Use the get_input_arguments() or get_output_arguments() method of the action
+# for a list of input / output arguments.
+# Example output of the get_input_arguments method for the "AddPortMapping" action
+# Returns a dictionary:
+# [
+# {
+# "name": "NewRemoteHost",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewExternalPort",
+# "data_type": "ui2",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewProtocol",
+# "data_type": "string",
+# "allowed_value_list": [
+# "TCP",
+# "UDP"
+# ]
+# },
+# {
+# "name": "NewInternalPort",
+# "data_type": "ui2",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewInternalClient",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewEnabled",
+# "data_type": "boolean",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewPortMappingDescription",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewLeaseDuration",
+# "data_type": "ui4",
+# "allowed_value_list": []
+# }
+# ]
+service.AddPortMapping.get_input_arguments()
+
+# Finally, add the new port mapping to the IGD
+# This specific action returns an empty dict: {}
+service.AddPortMapping(
+ NewRemoteHost='',
+ NewExternalPort=80,
+ NewProtocol='TCP',
+ NewInternalPort=8000,
+ NewInternalClient='192.168.1.3',
+ NewEnabled=1,
+ NewPortMappingDescription='Test port mapping entry from UPnPy.',
+ NewLeaseDuration=0
+)
+```
+
+## Documentation
+Documentation is available at [https://upnpy.readthedocs.io/en/latest/](https://upnpy.readthedocs.io/en/latest/)
+
+## License
+This project is licensed under the terms of the [MIT License](https://github.com/5kyc0d3r/upnpy/blob/master/LICENSE).
+
+%package help
+Summary: Development documents and examples for UPnPy
+Provides: python3-UPnPy-doc
+%description help
+# UPnPy
+[![Build Status](https://travis-ci.org/5kyc0d3r/upnpy.svg?branch=master)](https://travis-ci.org/5kyc0d3r/upnpy)
+[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/upnpy.svg)](https://pypi.org/project/UPnPy/)
+[![PyPI package version](https://img.shields.io/pypi/v/upnpy.svg)](https://pypi.org/project/UPnPy/)
+[![MIT License](https://img.shields.io/badge/license-MIT-red.svg)](https://github.com/5kyc0d3r/upnpy/blob/master/LICENSE)
+
+Lightweight UPnP client library for Python.
+
+## Install
+```
+$ pip install upnpy
+```
+
+## Examples
+
+#### Get the external IP address of an [Internet Gateway Device](https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol):
+```python
+import upnpy
+
+upnp = upnpy.UPnP()
+
+# Discover UPnP devices on the network
+# Returns a list of devices e.g.: [Device <Broadcom ADSL Router>]
+devices = upnp.discover()
+
+# Select the IGD
+# alternatively you can select the device directly from the list
+# device = devices[0]
+device = upnp.get_igd()
+
+# Get the services available for this device
+# Returns a list of services available for the device
+# e.g.: [<Service (WANPPPConnection) id="WANPPPConnection.1">, ...]
+device.get_services()
+
+# We can now access a specific service on the device by its ID
+# The IDs for the services in this case contain illegal values so we can't access it by an attribute
+# If the service ID didn't contain illegal values we could access it via an attribute like this:
+# service = device.WANPPPConnection
+
+# We will access it like a dictionary instead:
+service = device['WANPPPConnection.1']
+
+# Get the actions available for the service
+# Returns a list of actions for the service:
+# [<Action name="SetConnectionType">,
+# <Action name="GetConnectionTypeInfo">,
+# <Action name="RequestConnection">,
+# <Action name="ForceTermination">,
+# <Action name="GetStatusInfo">,
+# <Action name="GetNATRSIPStatus">,
+# <Action name="GetGenericPortMappingEntry">,
+# <Action name="GetSpecificPortMappingEntry">,
+# <Action name="AddPortMapping">,
+# <Action name="DeletePortMapping">,
+# <Action name="GetExternalIPAddress">]
+service.get_actions()
+
+# Finally, get the external IP address
+# Execute the action by its name
+# Returns a dictionary: {'NewExternalIPAddress': 'xxx.xxx.xxx.xxx'}
+service.GetExternalIPAddress()
+```
+
+#### Add a new port mapping to an [Internet Gateway Device](https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol):
+```python
+import upnpy
+
+upnp = upnpy.UPnP()
+
+# Discover UPnP devices on the network
+# Returns a list of devices e.g.: [Device <Broadcom ADSL Router>]
+devices = upnp.discover()
+
+# Select the IGD
+# alternatively you can select the device directly from the list
+# device = devices[0]
+device = upnp.get_igd()
+
+# Get the services available for this device
+# Returns a list of services available for the device
+# e.g.: [<Service (WANPPPConnection) id="WANPPPConnection.1">, ...]
+device.get_services()
+
+# We can now access a specific service on the device by its ID
+# The IDs for the services in this case contain illegal values so we can't access it by an attribute
+# If the service ID didn't contain illegal values we could access it via an attribute like this:
+# service = device.WANPPPConnection
+
+# We will access it like a dictionary instead:
+service = device['WANPPPConnection.1']
+
+# Get the actions available for the service
+# Returns a list of actions for the service:
+# [<Action name="SetConnectionType">,
+# <Action name="GetConnectionTypeInfo">,
+# <Action name="RequestConnection">,
+# <Action name="ForceTermination">,
+# <Action name="GetStatusInfo">,
+# <Action name="GetNATRSIPStatus">,
+# <Action name="GetGenericPortMappingEntry">,
+# <Action name="GetSpecificPortMappingEntry">,
+# <Action name="AddPortMapping">,
+# <Action name="DeletePortMapping">,
+# <Action name="GetExternalIPAddress">]
+service.get_actions()
+
+# The action we are looking for is the "AddPortMapping" action
+# Lets see what arguments the action accepts
+# Use the get_input_arguments() or get_output_arguments() method of the action
+# for a list of input / output arguments.
+# Example output of the get_input_arguments method for the "AddPortMapping" action
+# Returns a dictionary:
+# [
+# {
+# "name": "NewRemoteHost",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewExternalPort",
+# "data_type": "ui2",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewProtocol",
+# "data_type": "string",
+# "allowed_value_list": [
+# "TCP",
+# "UDP"
+# ]
+# },
+# {
+# "name": "NewInternalPort",
+# "data_type": "ui2",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewInternalClient",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewEnabled",
+# "data_type": "boolean",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewPortMappingDescription",
+# "data_type": "string",
+# "allowed_value_list": []
+# },
+# {
+# "name": "NewLeaseDuration",
+# "data_type": "ui4",
+# "allowed_value_list": []
+# }
+# ]
+service.AddPortMapping.get_input_arguments()
+
+# Finally, add the new port mapping to the IGD
+# This specific action returns an empty dict: {}
+service.AddPortMapping(
+ NewRemoteHost='',
+ NewExternalPort=80,
+ NewProtocol='TCP',
+ NewInternalPort=8000,
+ NewInternalClient='192.168.1.3',
+ NewEnabled=1,
+ NewPortMappingDescription='Test port mapping entry from UPnPy.',
+ NewLeaseDuration=0
+)
+```
+
+## Documentation
+Documentation is available at [https://upnpy.readthedocs.io/en/latest/](https://upnpy.readthedocs.io/en/latest/)
+
+## License
+This project is licensed under the terms of the [MIT License](https://github.com/5kyc0d3r/upnpy/blob/master/LICENSE).
+
+%prep
+%autosetup -n UPnPy-1.1.8
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-UPnPy -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu Mar 09 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.8-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..31c77e4
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+b33ad0b38e39af258e2c8f38813abf7b UPnPy-1.1.8.tar.gz