mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 10:31:34 -08:00
add new example 'advanced-qml-auto-reload' (single file reload); revisions
This commit is contained in:
parent
5f3b251a69
commit
1473ec8271
28 changed files with 1144 additions and 2 deletions
20
examples/advanced-qml-auto-reload/cgi-bin/qml-last-modified.py
Executable file
20
examples/advanced-qml-auto-reload/cgi-bin/qml-last-modified.py
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
|
||||
total = 0
|
||||
max_secs = 0
|
||||
edited_file = ''
|
||||
|
||||
for root, dirs, files in os.walk('qml'):
|
||||
for name in files:
|
||||
if name.endswith('.qml'):
|
||||
current_file = os.path.join(root, name)
|
||||
secs = int(os.path.getctime(os.path.abspath(current_file)))
|
||||
total += secs
|
||||
if (secs > max_secs):
|
||||
max_secs = secs
|
||||
edited_file = current_file
|
||||
|
||||
print('Content-type:text/plain\r\n\r\n')
|
||||
print(str(total) + '\r\n' + edited_file[4:])
|
||||
Loading…
Add table
Add a link
Reference in a new issue