-
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.
TgBot++: android_builder: Make PythonClass singleton
- Make a sperate fd for python script log - Slience EBADF log - And other improvements
- Loading branch information
Showing
15 changed files
with
438 additions
and
248 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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
|
||
def print_fd(*args, **kwargs): | ||
""" | ||
Prints the provided arguments to the file descriptor specified by the environment variable 'PYTHON_LOG_FD'. | ||
Parameters: | ||
*args: Variable length argument list. The arguments to be printed. | ||
**kwargs: Arbitrary keyword arguments. The arguments to be passed to the print function. | ||
Returns: | ||
None | ||
Note: | ||
The file descriptor should be opened in write mode ('w') before using this function. | ||
The file descriptor will be closed after printing the arguments. | ||
""" | ||
print(*args, **kwargs) | ||
if False: # Tmp disabled | ||
logfd = int(os.environ['PYTHON_LOG_FD']) | ||
out = open(logfd, 'w') | ||
print(*args, file=out, **kwargs) | ||
out.close() |
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.