diff --git a/README.org b/README.org index 2a02181..653bb63 100644 --- a/README.org +++ b/README.org @@ -33,8 +33,11 @@ Short list of features: Be prepared to have a working c and c++ compiler with python development library. Note I only have tested on linux. -You will also need the PyQt6 library, as I believe it can't be installed through -pip. It's easy to install using any package manager though. +You will also need the PyQt6 library, which can be installed via pip (or the +system package manager): +#+BEGIN_SRC bash +pip install PyQt6 PyQt6-WebEngine +#+END_SRC Then you have to check out the repository (do not forget the *recursive* flag): diff --git a/c/adblock.c b/c/adblock.cc similarity index 100% rename from c/adblock.c rename to c/adblock.cc diff --git a/setup.py b/setup.py index 0e8024c..1c5b62c 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ language="c++", include_dirs=[bloom_dir, hashset_dir, adblock_dir], # not sure if that help for speed. Careful it strip the debug symbols - extra_compile_args=["-g0", "-std=c++11"], + extra_compile_args=(["-g0", "-std=c++11"] if os.name != "nt" else []), sources=[ os.path.join(bloom_dir, "BloomFilter.cpp"), os.path.join(bloom_dir, "hashFn.cpp"), @@ -49,7 +49,7 @@ os.path.join(adblock_dir, "cosmetic_filter.cc"), os.path.join(adblock_dir, "no_fingerprint_domain.cc"), os.path.join(adblock_dir, "protocol.cc"), - os.path.join(THIS_DIR, "c", "adblock.c"), + os.path.join(THIS_DIR, "c", "adblock.cc"), ]) diff --git a/webmacs/adblock.py b/webmacs/adblock.py index c3a1802..f296450 100644 --- a/webmacs/adblock.py +++ b/webmacs/adblock.py @@ -155,9 +155,9 @@ def _dl_ready_read(self): file_time = datetime.fromtimestamp( os.path.getmtime(data["path"]), timezone.utc) if last_modified < file_time: - logging.info("no need to download adblock rule: %s", url) + logging.info("no need to download adblock rule: %s", reply.url) # touch on the file - os.utime(path, None) + os.utime(data["path"], None) self._close_reply(reply) self._maybe_finish() return diff --git a/webmacs/ipc.py b/webmacs/ipc.py index 865fa83..9dc83c1 100644 --- a/webmacs/ipc.py +++ b/webmacs/ipc.py @@ -75,8 +75,11 @@ def clear(self): class IpcServer(QObject): @classmethod def get_sock_name(cls, instance): - run_path = f"/run/user/{os.getuid()}" - prefix = run_path if os.access(run_path, os.W_OK) else "" + if os.name == "nt": + prefix = "" + else: + run_path = f"/run/user/{os.getuid()}" + prefix = run_path if os.access(run_path, os.W_OK) else "" if instance == "default": return os.path.join(prefix, "webmacs.ipc") diff --git a/webmacs/main.py b/webmacs/main.py index 455f011..20ca640 100644 --- a/webmacs/main.py +++ b/webmacs/main.py @@ -316,7 +316,8 @@ def main(): setup_logging_on_disk(os.path.join(conf_path, "logs"), backup_count=log_to_disk.value) app.post_init() - signal_wakeup(app) + if os.name != "nt": + signal_wakeup(app) signal.signal(signal.SIGINT, lambda s, h: app.quit()) sys.exit(app.exec())