当前位置: 首页>>代码示例>>Python>>正文


Python Commons.current_timestamp方法代码示例

本文整理汇总了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
开发者ID:,项目名称:,代码行数:12,代码来源:

示例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
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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
开发者ID:,项目名称:,代码行数:21,代码来源:

示例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
开发者ID:,项目名称:,代码行数:7,代码来源:

示例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
开发者ID:,项目名称:,代码行数:6,代码来源:

示例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
开发者ID:,项目名称:,代码行数:6,代码来源:

示例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
开发者ID:,项目名称:,代码行数:7,代码来源:

示例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
开发者ID:,项目名称:,代码行数:7,代码来源:

示例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
开发者ID:,项目名称:,代码行数:7,代码来源:

示例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
开发者ID:,项目名称:,代码行数:6,代码来源:

示例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."
开发者ID:joshcoales,项目名称:Hallo,代码行数:7,代码来源:testCommons.py

示例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
开发者ID:,项目名称:,代码行数:7,代码来源:


注:本文中的inc.Commons.Commons.current_timestamp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。