mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-05-06 17:09:49 +00:00
Compare commits
2 Commits
81c593399e
...
0a4e61edf5
Author | SHA1 | Date | |
---|---|---|---|
0a4e61edf5 | |||
d73a85b82e |
19
core/fs.py
19
core/fs.py
@ -13,6 +13,16 @@
|
||||
|
||||
import os
|
||||
|
||||
from math import floor
|
||||
import logging
|
||||
import sqlite3
|
||||
from threading import Lock
|
||||
from typing import Any, AnyStr, Union, Callable
|
||||
|
||||
from pathlib import Path
|
||||
from hscommon.util import nonone, get_file_ext
|
||||
|
||||
hasher: Callable
|
||||
try:
|
||||
import xxhash
|
||||
|
||||
@ -22,15 +32,6 @@ except ImportError:
|
||||
|
||||
hasher = hashlib.md5
|
||||
|
||||
from math import floor
|
||||
import logging
|
||||
import sqlite3
|
||||
from threading import Lock
|
||||
from typing import Any, AnyStr, Union
|
||||
|
||||
from pathlib import Path
|
||||
from hscommon.util import nonone, get_file_ext
|
||||
|
||||
__all__ = [
|
||||
"File",
|
||||
"Folder",
|
||||
|
13
core/pe/block.pyi
Normal file
13
core/pe/block.pyi
Normal file
@ -0,0 +1,13 @@
|
||||
from typing import Tuple, List, Union, Sequence
|
||||
|
||||
_block = Tuple[int, int, int]
|
||||
|
||||
class NoBlocksError(Exception): ... # noqa: E302, E701
|
||||
class DifferentBlockCountError(Exception): ... # noqa E701
|
||||
|
||||
def getblock(image: object) -> Union[_block, None]: ... # noqa: E302
|
||||
def getblocks2(image: object, block_count_per_side: int) -> Union[List[_block], None]: ...
|
||||
def diff(first: _block, second: _block) -> int: ...
|
||||
def avgdiff( # noqa: E302
|
||||
first: Sequence[_block], second: Sequence[_block], limit: int = 768, min_iterations: int = 1
|
||||
) -> Union[int, None]: ...
|
6
core/pe/cache.pyi
Normal file
6
core/pe/cache.pyi
Normal file
@ -0,0 +1,6 @@
|
||||
from typing import Union, Tuple, List
|
||||
|
||||
_block = Tuple[int, int, int]
|
||||
|
||||
def colors_to_string(colors: List[_block]) -> str: ... # noqa: E302
|
||||
def string_to_colors(s: str) -> Union[List[_block], None]: ...
|
@ -6,6 +6,16 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import typing
|
||||
from os import urandom
|
||||
|
||||
from pathlib import Path
|
||||
from hscommon.testutil import eq_
|
||||
from core.tests.directories_test import create_fake_fs
|
||||
|
||||
from .. import fs
|
||||
|
||||
hasher: typing.Callable
|
||||
try:
|
||||
import xxhash
|
||||
|
||||
@ -15,14 +25,6 @@ except ImportError:
|
||||
|
||||
hasher = hashlib.md5
|
||||
|
||||
from os import urandom
|
||||
|
||||
from pathlib import Path
|
||||
from hscommon.testutil import eq_
|
||||
from core.tests.directories_test import create_fake_fs
|
||||
|
||||
from .. import fs
|
||||
|
||||
|
||||
def create_fake_fs_with_random_data(rootpath):
|
||||
rootpath = rootpath.joinpath("fs")
|
||||
|
7
qt/pe/block.pyi
Normal file
7
qt/pe/block.pyi
Normal file
@ -0,0 +1,7 @@
|
||||
from typing import Tuple, List, Union
|
||||
from PyQt5.QtGui import QImage
|
||||
|
||||
_block = Tuple[int, int, int]
|
||||
|
||||
def getblock(image: QImage) -> _block: ... # noqa: E302
|
||||
def getblocks(image: QImage, block_count_per_side: int) -> Union[List[_block], None]: ...
|
@ -6,6 +6,7 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import typing
|
||||
from PyQt5.QtCore import (
|
||||
Qt,
|
||||
QAbstractTableModel,
|
||||
@ -14,13 +15,13 @@ from PyQt5.QtCore import (
|
||||
QItemSelection,
|
||||
)
|
||||
|
||||
from .column import Columns
|
||||
from .column import Columns, Column
|
||||
|
||||
|
||||
class Table(QAbstractTableModel):
|
||||
# Flags you want when index.isValid() is False. In those cases, _getFlags() is never called.
|
||||
INVALID_INDEX_FLAGS = Qt.ItemIsEnabled
|
||||
COLUMNS = []
|
||||
INVALID_INDEX_FLAGS = Qt.ItemFlag.ItemIsEnabled
|
||||
COLUMNS: typing.List[Column] = []
|
||||
|
||||
def __init__(self, model, view, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user