Skip to content

Update to v0.0.5 #4

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

Merged
merged 3 commits into from
Aug 7, 2021
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
2 changes: 1 addition & 1 deletion fsSignal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.0.4"
__version__ = "0.0.5"
__doc__ = """
Signal capturer v{}
Copyright (C) 2021 Fusion Solutions KFT <contact@fusionsolutions.io>
Expand Down
12 changes: 5 additions & 7 deletions fsSignal/fsSignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from threading import Event
from time import monotonic, sleep
from typing import Callable, Dict, Any, Iterator, Iterable, Optional, Union
from types import FrameType
# Third party modules
# Local modules
# Program
Expand Down Expand Up @@ -110,15 +109,14 @@ class HardSignal(BaseSignal):

class Signal(HardSignal):
_handler:Optional[Signal] = None
softKillFn:Optional[Callable[[Signals, FrameType], Any]]
hardKillFn:Optional[Callable[[Signals, FrameType], Any]]
softKillFn:Optional[Callable[..., Any]]
hardKillFn:Optional[Callable[..., Any]]
forceKillCounterFn:Optional[Callable[[int, int], Any]]
counter:int
forceCounter:int
eSoft:Event
eHard:Event
def __init__(self, softKillFn:Optional[Callable[[Signals, FrameType], Any]]=None,
hardKillFn:Optional[Callable[[Signals, FrameType], Any]]=None,
def __init__(self, softKillFn:Optional[Callable[..., Any]]=None, hardKillFn:Optional[Callable[..., Any]]=None,
forceKillCounterFn:Optional[Callable[[int, int], Any]]=None, forceCounter:int=10):
self.softKillFn = softKillFn
self.hardKillFn = hardKillFn
Expand Down Expand Up @@ -182,15 +180,15 @@ def _softKill(self) -> None:
self.eSoft.set()
if callable(self.softKillFn):
try:
self.softKillFn() # type: ignore
self.softKillFn()
except:
traceback.print_exc()
def _hardKill(self) -> None:
if not self.eHard.is_set():
self.eHard.set()
if callable(self.hardKillFn):
try:
self.hardKillFn() # type: ignore
self.hardKillFn()
except:
traceback.print_exc()
def _reset(self) -> None:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
import os, shutil
import os
import fsSignal
try:
from setuptools import setup
Expand All @@ -13,7 +13,7 @@
version = fsSignal.__version__,
description = "Signal capturer",
keywords = "signal capture utility fusion solutions fusionsolutions",
author = "Andor `iFA88` Rajci - Fusions Solutions KFT",
author = "Andor `iFA` Rajci - Fusions Solutions KFT",
author_email = "ifa@fusionsolutions.io",
url = "https://github.com/FusionSolutions/python-fssignal",
license = "GPL-3",
Expand Down