Permalink
Browse files

Moved hfos.tools -> hfos.misc

  • Loading branch information...
ri0t
ri0t committed Jul 7, 2018
1 parent 4b7fd1d commit 4d4a2db1c40f49b30dc2556a3852eb5d1ed2664d
View
@@ -17,7 +17,7 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from hfos.tools import insert_nginx_service
from hfos.tool.templates import insert_nginx_service
__author__ = "Heiko 'riot' Weinen"
__license__ = "AGPLv3"
@@ -7,11 +7,11 @@
from dateutil import parser
import click
from hfos.logger import hfoslog, warn, verbose, debug
from hfos.tools import std_uuid, std_now
from hfos.misc import std_uuid, std_now
def log(*args, **kwargs):
kwargs.update({'emitter': 'ICALIMPORT'})
kwargs.update({'emitter': 'ICALIMPORT', 'frame_ref': 2})
hfoslog(*args, **kwargs)
@@ -38,7 +38,7 @@
from hfos.database import objectmodels
from hfos.events.client import broadcast, send
from hfos.events.system import authorizedevent
from hfos.tools import std_now, std_uuid, std_table
from hfos.misc import std_now, std_uuid, std_table
from circuits import Event
from pymongo import DESCENDING
@@ -18,7 +18,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from hfos.tools import std_uuid
from hfos.misc import std_uuid
__author__ = "Heiko 'riot' Weinen"
__license__ = "AGPLv3"
@@ -42,13 +42,14 @@
from hfos.events.client import send
from hfos.database import objectmodels, instance
from hfos.logger import error, verbose, warn, debug
from hfos.tools import std_uuid
from hfos.misc import std_uuid
import datetime
import xml.etree.ElementTree
try:
from subprocess import Popen
except ImportError:
# noinspection PyUnresolvedReferences
from subprocess32 import Popen # NOQA
GDAL_LAYER_UUID = '6a18fdad-93a2-4563-bb8a-cb5888f43300'
@@ -43,7 +43,7 @@
from hfos.component import ConfigurableController, ConfigurableComponent, \
handler, authorizedevent
from hfos.events.client import send
from hfos.tools import std_uuid
from hfos.misc import std_uuid
from hfos.database import objectmodels, instance
from hfos.debugger import cli_register_event
from hfos.logger import error, verbose, warn, hilight
@@ -498,18 +498,18 @@ def tilecache(self, event, *args, **kwargs):
except OSError as e:
if e.errno != errno.EEXIST:
self.log(
"Couldn't create path: %s (%s)" % (e, type(e)))
"Couldn't create path: %s (%s)" % (e, type(e)), lvl=error)
self.log("Caching tile.", lvl=verbose)
try:
with open(filename, "wb") as tile_file:
try:
tile_file.write(bytes(tile))
except Exception as e:
self.log("Writing error: %s" % str([type(e), e]))
self.log("Writing error: %s" % str([type(e), e]), lvl=error)
except Exception as e:
self.log("Open error: %s" % str([type(e), e]))
self.log("Open error on %s - %s" % (filename, str([type(e), e])), lvl=error)
return
finally:
event.stop()
@@ -43,7 +43,7 @@
from hfos.component import ConfigurableComponent, LoggingComponent, handler
from hfos.database import ValidationError
from hfos.logger import hfoslog, verbose, debug, warn, critical, error, hilight
from hfos.tools import std_uuid
from hfos.misc import std_uuid
from hfos.navdata.events import sensordata
# from pprint import pprint
@@ -451,7 +451,7 @@ def _unregister_scanner(self, device):
@handler('register_protocol')
def register_protocol(self, event):
self.log('Registering scanner protocol:', event)
self.log('Registering scanner protocol:', event.protocol)
self.protocols[event.protocol] = event.keyword
@handler('restart_scan')
@@ -17,7 +17,7 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from hfos.tools import std_uuid
from hfos.misc import std_uuid
__author__ = "Heiko 'riot' Weinen"
__license__ = "AGPLv3"
@@ -158,7 +158,7 @@ def updatevessel(self, event):
@handler('referenceframe', channel='navdata')
def referenceframeupdate(self, event):
self.log('Reference update:', event.data, lvl=verbose)
self.log('Reference update:', event.data, lvl=events)
frame = event.data['data']
if 'GLL_lat' in frame and 'GLL_lon' in frame:
@@ -17,7 +17,7 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from hfos.tools import std_uuid, std_now
from hfos.misc import std_uuid, std_now
__author__ = "Heiko 'riot' Weinen"
__license__ = "AGPLv3"
@@ -37,7 +37,7 @@
from hfos.database import objectmodels, instance
from hfos.logger import verbose, debug, error, warn, critical, events, hilight
from hfos.events.system import authorizedevent
from hfos.tools import std_uuid
from hfos.misc import std_uuid
from urllib import request
try:

0 comments on commit 4d4a2db

Please sign in to comment.