-
Notifications
You must be signed in to change notification settings - Fork 1
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
6 changed files
with
54 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "saleyo" | ||
version = "1.3.0" | ||
version = "1.3.1" | ||
description = "Saleyo is a lightwight scalable Python AOP framework, easy to use and integrate." | ||
authors = [{ name = "H2Sxxa", email = "[email protected]" }] | ||
dependencies = [] | ||
|
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,6 +1,6 @@ | ||
def generate(name): | ||
return name + " static' tag" | ||
return name + " static" | ||
|
||
|
||
class StaticMap: | ||
FIELD = generate("hello") | ||
class Static: | ||
FIELD = generate("hello") |
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,15 +1,17 @@ | ||
from typing import Any, Union | ||
from saleyo.decorator.compile import CompileToken, CompileBoundary | ||
import targetmodule | ||
|
||
|
||
@CompileToken(lambda info: "targetmodule.py" in str(info.filename)) | ||
def mixin_a(token: Union[str, bytes, Any]): | ||
if not isinstance(token, bytes): | ||
return | ||
return token.replace(b"static' tag", b"bye") | ||
return token.replace(b"static", b"bye2") | ||
|
||
|
||
with CompileBoundary(): | ||
from targetmodule import StaticMap | ||
with CompileBoundary(no_cache=False) as compile: | ||
compile.recompile_module(targetmodule) | ||
|
||
print(StaticMap().FIELD) # hello bye | ||
|
||
print(targetmodule.Static().FIELD) # hello bye |