本文整理汇总了Python中inc.Commons.Commons.current_timestamp方法的典型用法代码示例。如果您正苦于以下问题:Python Commons.current_timestamp方法的具体用法?Python Commons.current_timestamp怎么用?Python Commons.current_timestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inc.Commons.Commons
的用法示例。
在下文中一共展示了Commons.current_timestamp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: log_ctcp
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def log_ctcp(self, full_line, server_obj, user_obj, channel_obj):
ctcp_command = full_line.split()[0]
ctcp_arguments = ' '.join(full_line.split()[1:])
if ctcp_command.lower() == "action":
output = Commons.current_timestamp() + " "
output += "**" + user_obj.get_name() + ' ' + ctcp_arguments + '**'
return output
output = Commons.current_timestamp() + " "
output += "<" + user_obj.get_name() + ' (CTCP)> ' + full_line
return output
示例2: print_ping
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_ping(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
if user_obj is None:
output += "["+server_obj.get_name() + "] PING"
else:
output += "["+server_obj.get_name() + "] PONG"
return output
示例3: print_kick
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_kick(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += user_obj.get_name() + " was kicked from " + channel_obj.get_name()
if full_line.strip() != "":
output += " (" + full_line + ")"
return output
示例4: print_quit
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_quit(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += user_obj.get_name() + " has quit."
if full_line.strip() != "":
output += " (" + full_line + ")"
return output
示例5: print_message
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_message(self, full_line, server_obj, user_obj, channel_obj):
destination_object = channel_obj
if channel_obj is None:
destination_object = user_obj
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += destination_object.get_name() + " "
output += "<" + user_obj.get_name() + "> " + full_line
return output
示例6: print_ctcp
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_ctcp(self, full_line, server_obj, user_obj, channel_obj):
# Get useful data and objects
ctcp_command = full_line.split()[0]
ctcp_arguments = ' '.join(full_line.split()[1:])
destination_obj = channel_obj
if channel_obj is None:
destination_obj = user_obj
# Print CTCP actions differently to other CTCP commands
if ctcp_command.lower() == "action":
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += destination_obj.get_name() + " "
output += "**" + user_obj.get_name() + " " + ctcp_arguments + "**"
return output
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += destination_obj.get_name() + " "
output += "<" + user_obj.get_name() + " (CTCP)> " + full_line
return output
示例7: print_join
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_join(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += user_obj.get_name() + " joined " + channel_obj.get_name()
return output
示例8: print_day
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_day(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += "Day changed: "+datetime.datetime.now().strftime("%Y-%m-%d")
return output
示例9: print_raw
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_raw(self, raw_text):
output = Commons.current_timestamp() + " " + \
raw_text
return output
示例10: print_notice
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_notice(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += "Notice from " + user_obj.get_name() + ": " + full_line
return output
示例11: print_invite
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_invite(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += "Invite to " + channel_obj.get_name() + ' from ' + user_obj.get_name()
return output
示例12: print_name_change
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_name_change(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += "Nick change: " + full_line + " -> " + user_obj.get_name()
return output
示例13: log_message
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def log_message(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += '<' + user_obj.get_name() + '> ' + full_line
return output
示例14: test_current_timestamp
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def test_current_timestamp(self):
stamp = Commons.current_timestamp()
assert len(stamp) == 10, "Timestamp is the wrong length"
pattern = re.compile("^\[(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\]$")
assert pattern.match(stamp), "Timestamp is not valid to defined format."
示例15: print_mode_change
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import current_timestamp [as 别名]
def print_mode_change(self, full_line, server_obj, user_obj, channel_obj):
output = Commons.current_timestamp() + " "
output += "[" + server_obj.get_name() + "] "
output += user_obj.get_name() + ' set ' + full_line + ' on ' + channel_obj.get_name()
return output