Skip to content

Commit e514aaf

Browse files
committed
Correct side panel
1 parent 8cf87e8 commit e514aaf

7 files changed

Lines changed: 67 additions & 690 deletions

File tree

project_info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project>
33
<name>BulkFolder</name>
4-
<version>1.7.5</version>
4+
<version>1.7.6/version>
55
<description>The safest and fastest bulk organizer and renamer.</description>
66
<author>Achraf KHABAR / Open Source Community</author>
77
<repository>https://github.com/Ashraf-Khabar/bulkfolder</repository>

src/bulkfolder/journal.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22
import json
3+
import os
4+
import ctypes
35
from dataclasses import dataclass
46
from pathlib import Path
57
from datetime import datetime, timezone
@@ -17,9 +19,20 @@ def journal_path_for(root: Path) -> Path:
1719

1820
def append_entries(jpath: Path, entries: Iterable[JournalEntry]) -> None:
1921
jpath.parent.mkdir(parents=True, exist_ok=True)
22+
23+
file_exists = jpath.exists()
24+
2025
with jpath.open("a", encoding="utf-8") as f:
2126
for e in entries:
2227
f.write(json.dumps(e.__dict__, ensure_ascii=False) + "\n")
28+
29+
# Rendre le fichier caché sous Windows lors de la création
30+
if not file_exists and os.name == 'nt':
31+
try:
32+
FILE_ATTRIBUTE_HIDDEN = 0x02
33+
ctypes.windll.kernel32.SetFileAttributesW(str(jpath), FILE_ATTRIBUTE_HIDDEN)
34+
except Exception:
35+
pass
2336

2437
def now_iso() -> str:
25-
return datetime.now(timezone.utc).isoformat()
38+
return datetime.now(timezone.utc).isoformat()

0 commit comments

Comments
 (0)