コード例 #1
0
ファイル: xmlFormat.py プロジェクト: bbockelm/glideinWMS
def time2xml(the_time, outer_tag, indent_tab=DEFAULT_TAB, leading_tab=""):
    xml_data = {"UTC":{"unixtime":timeConversion.getSeconds(the_time),
                     "ISO8601":timeConversion.getISO8601_UTC(the_time),
                     "RFC2822":timeConversion.getRFC2822_UTC(the_time)},
              "Local":{"ISO8601":timeConversion.getISO8601_Local(the_time),
                       "RFC2822":timeConversion.getRFC2822_Local(the_time),
                       "human":timeConversion.getHuman(the_time)}}
    return dict2string(xml_data,
                                 dict_name=outer_tag, el_name="timezone",
                                 subtypes_params={"class":{}},
                                 indent_tab=indent_tab, leading_tab=leading_tab)
コード例 #2
0
ファイル: xmlFormat.py プロジェクト: rynge/glideinwms
def time2xml(the_time, outer_tag, indent_tab=DEFAULT_TAB, leading_tab=""):
    xml_data = {
        "UTC": {
            "unixtime": timeConversion.getSeconds(the_time),
            "ISO8601": timeConversion.getISO8601_UTC(the_time),
            "RFC2822": timeConversion.getRFC2822_UTC(the_time)
        },
        "Local": {
            "ISO8601": timeConversion.getISO8601_Local(the_time),
            "RFC2822": timeConversion.getRFC2822_Local(the_time),
            "human": timeConversion.getHuman(the_time)
        }
    }
    return dict2string(xml_data,
                       dict_name=outer_tag,
                       el_name="timezone",
                       subtypes_params={"class": {}},
                       indent_tab=indent_tab,
                       leading_tab=leading_tab)
コード例 #3
0
 def test_rf_c2822_local_symmetric(self, flt_time):
     t = long(flt_time)
     tstr = getRFC2822_Local(flt_time)
     self.assertEqual(t, extractRFC2822_Local(getRFC2822_Local(flt_time)))
     self.assertEqual(tstr, getRFC2822_Local(extractRFC2822_Local(tstr)))
コード例 #4
0
 def test_get_rf_c2822__local(self):
     os.environ['TZ'] = tz
     time.tzset()
     self.assertEqual(rfc_2822_local, getRFC2822_Local(now))
コード例 #5
0
 def test_get_rf_c2822__local(self):
     os.environ['TZ'] = tz
     time.tzset()
     self.assertEqual(rfc_2822_local, getRFC2822_Local(now))
コード例 #6
0
 def test_rf_c2822_local_symmetric(self, flt_time):
     t = long(flt_time)
     tstr = getRFC2822_Local(flt_time)
     self.assertEqual(t, extractRFC2822_Local(getRFC2822_Local(flt_time)))
     self.assertEqual(tstr, getRFC2822_Local(extractRFC2822_Local(tstr)))