-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
337 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
# LTK - Copyrights Reserved 2023 - chrislaffra.com - See LICENSE | ||
|
||
import sys | ||
|
||
def fix_time(): | ||
import time | ||
|
||
if not hasattr(time, "time"): | ||
class MonkeyPatchedTimeModuleForMicroPython: | ||
""" Monkey patch for time.time() for MicroPython """ | ||
pass | ||
|
||
clone = MonkeyPatchedTimeModuleForMicroPython() | ||
for key in dir(time): | ||
setattr(clone, key, getattr(time, key)) | ||
setattr(clone, "time", lambda: time.ticks_ms() / 1000) | ||
sys.modules["time"] = clone | ||
|
||
fix_time() | ||
|
||
from ltk.jquery import * | ||
from ltk.widgets import * | ||
|
||
inject_script("ltk/ltk.js") | ||
inject_css("ltk/ltk.css") | ||
|
||
from ltk.jquery import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.