some cleanup of unneeded imports and other small cleanups
This commit is contained in:
@ -1,25 +1,22 @@
|
||||
|
||||
import copy
|
||||
import hashlib
|
||||
import inspect
|
||||
import json
|
||||
import nbformat
|
||||
import os
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
from multiprocessing.connection import Connection, wait as multi_wait
|
||||
from multiprocessing.queues import Queue
|
||||
from papermill.translators import papermill_translators
|
||||
from typing import Any, Union
|
||||
from typing import Any
|
||||
from random import SystemRandom
|
||||
|
||||
#from core.meow import BasePattern, BaseRecipe, BaseRule
|
||||
from core.correctness.validation import check_type, valid_dict, valid_list, \
|
||||
valid_existing_file_path, valid_path
|
||||
from core.correctness.validation import check_type, valid_existing_file_path, \
|
||||
valid_path
|
||||
from core.correctness.vars import CHAR_LOWERCASE, CHAR_UPPERCASE, \
|
||||
VALID_CHANNELS, HASH_BUFFER_SIZE, SHA256, DEBUG_WARNING, DEBUG_ERROR, \
|
||||
DEBUG_INFO, EVENT_TYPE
|
||||
VALID_CHANNELS, HASH_BUFFER_SIZE, SHA256, DEBUG_WARNING, DEBUG_INFO, \
|
||||
EVENT_TYPE
|
||||
|
||||
def generate_id(prefix:str="", length:int=16, existing_ids:list[str]=[],
|
||||
charset:str=CHAR_UPPERCASE+CHAR_LOWERCASE, attempts:int=24):
|
||||
|
10
core/meow.py
10
core/meow.py
@ -8,7 +8,7 @@ from typing import Any, Union
|
||||
|
||||
from core.correctness.vars import VALID_RECIPE_NAME_CHARS, \
|
||||
VALID_PATTERN_NAME_CHARS, VALID_RULE_NAME_CHARS, VALID_CHANNELS, \
|
||||
get_drt_imp_msg, DEBUG_WARNING, DEBUG_INFO, DEBUG_ERROR
|
||||
get_drt_imp_msg, DEBUG_WARNING, DEBUG_INFO
|
||||
from core.correctness.validation import valid_string, check_type, \
|
||||
check_implementation, valid_list, valid_dict, setup_debugging
|
||||
from core.functionality import print_debug, wait, generate_id
|
||||
@ -208,8 +208,8 @@ class MeowRunner:
|
||||
|
||||
def start(self)->None:
|
||||
self.monitor.start()
|
||||
#if hasattr(self.handler, "start"):
|
||||
# self.handler.start()
|
||||
if hasattr(self.handler, "start"):
|
||||
self.handler.start()
|
||||
|
||||
if self._worker is None:
|
||||
self._worker = threading.Thread(
|
||||
@ -228,8 +228,8 @@ class MeowRunner:
|
||||
|
||||
def stop(self)->None:
|
||||
self.monitor.stop()
|
||||
#if hasattr(self.handler, "stop"):
|
||||
# self.handler.stop()
|
||||
if hasattr(self.handler, "stop"):
|
||||
self.handler.stop()
|
||||
|
||||
if self._worker is None:
|
||||
msg = "Cannot stop thread that is not started."
|
||||
|
Reference in New Issue
Block a user