This file contains hidden or 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
| import select | |
| import socket | |
| import typing | |
| from urllib.parse import urlsplit | |
| class Task: | |
| def __init__(self, url): | |
| self.split = urlsplit(url) |
This file contains hidden or 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
| import select | |
| import socket | |
| from urllib.parse import urlsplit | |
| class Loop: | |
| ACTION_READ = 'read' | |
| ACTION_WRITE = 'write' | |
| ACTION_READY = 'ready' |
This file contains hidden or 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
| #!/bin/sh | |
| LOCKFILE="/tmp/script.lock" | |
| LOGFILE="/tmp/script.log" | |
| COMMAND="/usr/bin/php7 /home/rinat/myscript.php" | |
| ( | |
| if flock -n 200 | |
| then | |
| echo "["$(date)"] Running command $COMMAND" | tee -a $LOGFILE |
This file contains hidden or 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
| def profile(func): | |
| from functools import wraps | |
| @wraps(func) | |
| def wrapper(*args, **kwargs): | |
| from line_profiler import LineProfiler | |
| prof = LineProfiler() | |
| try: | |
| return prof(func)(*args, **kwargs) | |
| finally: |
This file contains hidden or 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
| def _get_flatten_wsdl(self, url): | |
| """ | |
| Выполняет загрузку wsdl-схемы и зависимых файлов и объединяет их | |
| в единый файл. | |
| Ускоряет загрузку wsdl-схемы для клиента. | |
| TODO: реализовать. | |
| :type url: unicode |
NewerOlder