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


Python TimeAgent.utcoffset方法代码示例

本文整理汇总了Python中nell.utilities.TimeAgent.utcoffset方法的典型用法代码示例。如果您正苦于以下问题:Python TimeAgent.utcoffset方法的具体用法?Python TimeAgent.utcoffset怎么用?Python TimeAgent.utcoffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nell.utilities.TimeAgent的用法示例。


在下文中一共展示了TimeAgent.utcoffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from nell.utilities import TimeAgent [as 别名]
# 或者: from nell.utilities.TimeAgent import utcoffset [as 别名]
    def setUp(self):
        super(TestEmail, self).setUp()

        weekdays = {"0" : "Sun",
                    "1" : "Mon",
                    "2" : "Tue",
                    "3" : "Wed",
                    "4" : "Thu",
                    "5" : "Fri",
                    "6" : "Sat"}

        months = {"1"  : "Jan",
                  "2"  : "Feb",
                  "3"  : "Mar",
                  "4"  : "Apr",
                  "5"  : "May",
                  "6"  : "Jun",
                  "7"  : "Jul",
                  "8"  : "Aug",
                  "9"  : "Sep",
                  "10" : "Oct",
                  "11" : "Nov",
                  "12" : "Dec"}
        
        self.sender = "[email protected]"
        self.recipients_list = ["[email protected]", "[email protected]"]
        self.recipients = "[email protected],[email protected]"
        self.subject = "Flies are yummy"
        self.body = "Delicious!"
        self.date = datetime.now()
        self.datestring = "%s, %s %s %s -0%d00" % (weekdays[self.date.strftime("%w")],
                                                   self.date.strftime("%d"),
                                                   months[str(int(self.date.strftime("%m")))],
                                                   self.date.strftime("%Y %H:%M:%S"),
                                                   TimeAgent.utcoffset())

        self.text =  'From: %s\r\nTo: %s\r\nDate: %s\r\nSubject: %s\r\n\r\n%s\r\n' \
            % (self.sender, self.recipients, self.datestring, self.subject, self.body)

        self.e1 = Email()
        self.e2 = Email(sender = self.sender,
                        recipients = self.recipients,
                        subject = self.subject,
                        body = self.body,
                        date = self.date)
开发者ID:mmccarty,项目名称:nell,代码行数:47,代码来源:TestEmail.py


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