本文整理汇总了Python中Logging.warning方法的典型用法代码示例。如果您正苦于以下问题:Python Logging.warning方法的具体用法?Python Logging.warning怎么用?Python Logging.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logging
的用法示例。
在下文中一共展示了Logging.warning方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_channel
# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import warning [as 别名]
def update_channel(self, channel):
assert isinstance(channel, Channel.Channel)
if channel.is_none_event():
Logging.warning('update_channel listen event is none, skip.')
return
self._channelMap[channel.fd()] = channel
self.__control(channel.fd(), channel.event(), select.KQ_EV_ADD)
示例2: __init__
# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import warning [as 别名]
def __init__(self, source_path, binary_path):
self.source_path = os.path.abspath(source_path) + "/"
self.binary_path = os.path.abspath(binary_path) + "/"
self.wallaby_library_avaliable = os.path.isfile("/usr/local/lib/libaurora.so") and os.path.isfile("/usr/local/lib/libdaylite.so")
if not self.wallaby_library_avaliable:
Logging.warning("Wallaby library not found. All Wallaby functions are unavaliable.")
if platform.machine() != "armv7l":
Logging.warning("Wrong processor architecture! Generated binaries will not run on Wallaby Controllers.")
示例3: run
# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import warning [as 别名]
def run(self, data, handler):
if type(data) is dict:
if "add" in data:
for file in data["add"]:
self.suppress_fs_event(file)
folder_path = self.folder + os.path.dirname(file)
if not os.path.exists(folder_path):
os.makedirs(folder_path)
mode = "wb+" if os.path.exists(self.folder + file) else "ab+"
open(self.folder + file, mode).write(base64.b64decode(data["add"][file]["content"]))
os.utime(self.folder + file, (data["add"][file]["mtime"], data["add"][file]["mtime"]))
"""
for file in data["add"]:
if not file in self.suppressed_fs_events:
self.suppress_fs_event(file)
folder_path = self.folder + os.path.dirname(file)
if not os.path.exists(folder_path):
os.makedirs(folder_path)
if os.path.exists:
open(self.folder + file, "wb+").write(base64.b64decode(data["add"][file]["content"]))
else:
open(self.folder + file, "ab+").write(base64.b64decode(data["add"][file]["content"]))
os.utime(self.folder + file, (data["add"][file]["mtime"], data["add"][file]["mtime"]))
else:
self.unsuppress_fs_event(file)
"""
elif "del" in data:
for file in data["del"]:
self.suppress_fs_event(file)
try:
os.remove(self.folder + file)
except FileNotFoundError:
self.unsuppress_fs_event(file)
Logging.warning("Possible server misbehaviour")
elif "deldir" in data:
for dir in data["deldir"]:
if os.path.exists(self.folder + dir):
for folder in relative_recursive_folder_ls(self.folder + dir, self.folder):
self.suppress_fs_event(folder)
for file in relative_recursive_ls(self.folder + dir, self.folder):
self.suppress_fs_event(file)
self.suppress_fs_event(dir)
shutil.rmtree(self.folder + dir)
else:
Logging.warning("Possible server misbehaviour")
elif "mvd" in data:
for file in data["mvd"]:
if os.path.isfile(self.folder + file):
new_name = self.folder + data["mvd"][file]
if os.path.exists(os.path.dirname(new_name)):
self.suppress_fs_event(file)
shutil.move(self.folder + file, new_name)
elif "req" in data:
for file in data["req"]:
if file in self.files:
self.sock.send({"add" : {file : {"content" : base64_str_decode(self.folder + file),
"mtime" : os.path.getmtime(self.folder + file)}}}, self.route)
示例4: update_channel
# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import warning [as 别名]
def update_channel(self, channel):
"""
:type self: void
"""
assert isinstance(channel, Channel)
if channel.is_none_event():
Logging.warning('update_channel listen event is none, skip.')
return
self._channelMap[channel.fd()] = channel
self._poller.register(channel.fd(), channel.event())
示例5: is_wallaby
# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import warning [as 别名]
import os
import sys
import platform
import subprocess
import _thread
CHANNEL = "w"
IS_WALLABY = is_wallaby()
PATH = "/home/root/Documents/KISS/bin/" if IS_WALLABY else (sys.argv[1] if len(sys.argv) > 1 else None)
if not PATH:
Logging.error("No path specified. (Necessary on simulated Wallaby controllers.)")
exit(1)
if not IS_WALLABY:
Logging.warning("Binaries that were created for Wallaby Controllers will not run on a simulated Wallaby.")
class WallabyControl(Routing.ClientRoute):
def __init__(self, output_unbuffer):
self.output_unbuffer = output_unbuffer
self.actions_with_params = {"run" : self.run_program}
self.actions_without_params = {"disconnect" : self.disconnect,
"reboot" : self.reboot, "shutdown" : self.shutdown, "stop" : self.stop}
self.currently_running_program = None
def run(self, data, handler):
if type(data) is str:
if data in self.actions_without_params.keys():
self.actions_without_params[data](handler)
elif type(data) is dict:
for action in data: