Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/network_reqs #6

Merged
merged 4 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
dev.env
.dev_opts.json
.idea
*.code-workspace
*.pyc
*.swp
*~
*.egg-info/
build
dist
.coverage
/htmlcov
.installed
.mypy_cache
.vscode
.theia
.venv/

# Created by unit tests
.pytest_cache/
58 changes: 0 additions & 58 deletions build/lib/ovos_phal_plugin_ipgeo/__init__.py

This file was deleted.

7 changes: 0 additions & 7 deletions build/lib/ovos_phal_plugin_ipgeo/version.py

This file was deleted.

Binary file removed dist/ovos-phal-plugin-ipgeo-0.0.1.tar.gz
Binary file not shown.
Binary file removed dist/ovos_phal_plugin_ipgeo-0.0.1-py3-none-any.whl
Binary file not shown.
17 changes: 0 additions & 17 deletions ovos_phal_plugin_ipgeo.egg-info/PKG-INFO

This file was deleted.

13 changes: 0 additions & 13 deletions ovos_phal_plugin_ipgeo.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion ovos_phal_plugin_ipgeo.egg-info/dependency_links.txt

This file was deleted.

3 changes: 0 additions & 3 deletions ovos_phal_plugin_ipgeo.egg-info/entry_points.txt

This file was deleted.

2 changes: 0 additions & 2 deletions ovos_phal_plugin_ipgeo.egg-info/requires.txt

This file was deleted.

1 change: 0 additions & 1 deletion ovos_phal_plugin_ipgeo.egg-info/top_level.txt

This file was deleted.

1 change: 0 additions & 1 deletion ovos_phal_plugin_ipgeo.egg-info/zip-safe

This file was deleted.

12 changes: 12 additions & 0 deletions ovos_phal_plugin_ipgeo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import requests

from ovos_plugin_manager.phal import PHALPlugin
from ovos_config.config import LocalConf
from ovos_config.locations import get_webcache_location
from ovos_utils.messagebus import Message
from ovos_utils import classproperty
from ovos_utils.process_utils import RuntimeRequirements


class IPGeoPlugin(PHALPlugin):
Expand All @@ -14,6 +17,15 @@ def __init__(self, bus=None, config=None):
self.bus.on("ovos.ipgeo.update", self.on_reset)
self.on_reset() # get initial location data

@classproperty
def runtime_requirements(self):
return RuntimeRequirements(internet_before_load=True,
network_before_load=True,
requires_internet=True,
requires_network=True,
no_internet_fallback=False,
no_network_fallback=False)

def on_reset(self, message=None):
# we update the remote config to allow
# both backend and user config to take precedence
Expand Down