Skip to content

Commit d1ecd27

Browse files
author
dsalem
committed
done with framagitr issue #91
1 parent 853c71d commit d1ecd27

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@
4141
TODO | Verify header id uniqueness or warn about W3C complience.
4242
TODO | Add post-generation warning information. For example calling GetEntryPath while single entry pages is disabled should not be silent.
4343

44+
# version 3.2.2
45+
DONE | Framagit issue #91 : Adding or modifying file in extra/ and/or theme/assets was refresh site with venc -s
46+
TODO | Framagit issue #92 : GetLastEntryTimestamp is not relevant when used in another thread.
47+
48+
# version 3.2.1
49+
DONE | Fix framagit issue #87 : {path} variable was broken and return absolute path
50+
4451
# version 3.2.0
4552
DONE | Use EDITOR environment variable if available.
4653
DONE | Enhance blog_configuration sanitation.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# Documentations
44

5-
- [VenC 3.2.0 - Français](https://venc.software/)
5+
- [VenC 3.2 - Français](https://venc.software/)

src/venc3/commands/serv.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ def get_files(folder=".."):
3939
for item in os.listdir(folder):
4040
if item in ["extra", "includes", "entries", "theme", "blog_configuration.yaml"] or (folder != ".."):
4141
if item[0] != '.':
42+
files += [folder+"/"+item]
4243
if os.path.isdir(folder+"/"+item):
4344
files += get_files(folder+"/"+item)
44-
else:
45-
files += [folder+"/"+item]
46-
4745
return files
4846

4947
def watch_files():
@@ -56,8 +54,8 @@ def watch_files():
5654
files = get_files()
5755
for path in files:
5856
WATCHED_FILES[path] = os.path.getmtime(path)
59-
if WATCHED_FILES[path] > LAST_WATCH_PASS:
60-
if path[:len("../extra")] == "../extra":
57+
if WATCHED_FILES[path] > LAST_WATCH_PASS and not os.path.isdir(path):
58+
if path[:len("../extra")] == "../extra" :
6159
refresh_extra |= True
6260

6361
elif path[:len("../theme/assets")] == "../theme/assets":
@@ -85,12 +83,15 @@ def watch_files():
8583

8684
if to_delete != None:
8785
notify(("deleting_file", to_delete))
88-
if os.path.isdir("../"+to_delete):
89-
shutil.rmtree("../"+to_delete)
90-
91-
else:
92-
os.unlink("../"+to_delete)
93-
86+
try:
87+
if os.path.isdir("../"+to_delete):
88+
shutil.rmtree("../"+to_delete)
89+
90+
else:
91+
os.unlink("../"+to_delete)
92+
except FileNotFoundError:
93+
pass
94+
9495
LAST_WATCH_PASS = time.time()
9596

9697
if refresh_all:

0 commit comments

Comments
 (0)