-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from thenaterhood/dev
Next Release
- Loading branch information
Showing
43 changed files
with
1,293 additions
and
964 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ jobs: | |
# uses: cclauss/GitHub-Action-for-pylint@8ef4d22e119fb1cdc0f58f2e95cb1f8d8b0d55e6 | ||
uses: cclauss/[email protected] | ||
with: | ||
args: '"pylint src/ --disable=import-error --disable=no-self-use --disable=no-else-return --disable=too-many-public-methods --disable=too-many-instance-attributes --disable=duplicate-code --disable=useless-object-inheritance --disable=too-few-public-methods"' | ||
args: '"pylint src/ --disable=import-error --disable=no-self-use --disable=no-else-return --disable=too-many-public-methods --disable=too-many-instance-attributes --disable=duplicate-code --disable=useless-object-inheritance --disable=too-few-public-methods" --disable=missing-module-docstring' | ||
|
||
pytest: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,6 @@ | ||
''' | ||
Interface class for integrating cursor locators | ||
''' | ||
import typing | ||
from .factory import get_cursor_locator | ||
|
||
|
||
class CursorLocator(): | ||
'''Parent class for cursor locator strategies''' | ||
|
||
__utilityname__: str = "default" | ||
|
||
def __init__(self): | ||
"""constructor""" | ||
|
||
def get_cursor_position(self) -> typing.Optional[typing.Tuple[int, int]]: | ||
'''Return the cursor position as a tuple of (x, y)''' | ||
raise NotImplementedError() | ||
|
||
@staticmethod | ||
def can_run() -> bool: | ||
""" | ||
Whether this cursor locator can run | ||
""" | ||
return True | ||
__all__ = [ | ||
"get_cursor_locator", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
''' | ||
Interface class for integrating cursor locators | ||
''' | ||
import typing | ||
|
||
from gscreenshot.scaling import get_scaling_factor | ||
|
||
|
||
class CursorLocator(): | ||
'''Parent class for cursor locator strategies''' | ||
|
||
__utilityname__: str = "default" | ||
|
||
def __init__(self): | ||
"""constructor""" | ||
|
||
def get_cursor_position(self) -> typing.Optional[typing.Tuple[int, int]]: | ||
'''Return the cursor position as a tuple of (x, y)''' | ||
raise NotImplementedError() | ||
|
||
def get_cursor_position_adjusted(self): | ||
'''Return the cursor position adjusted for scaling''' | ||
position = self.get_cursor_position() | ||
|
||
if not position: | ||
return None | ||
|
||
scaling_factor = get_scaling_factor() | ||
return ( | ||
round(position[0] * scaling_factor), | ||
round(position[1] * scaling_factor) | ||
) | ||
|
||
@staticmethod | ||
def can_run() -> bool: | ||
""" | ||
Whether this cursor locator can run | ||
""" | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.