Skip to content
Open
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
7 changes: 5 additions & 2 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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"),
])


Expand Down
4 changes: 2 additions & 2 deletions webmacs/adblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions webmacs/ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion webmacs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down