本文整理汇总了Python中Utils.Utils.get_utc_date_time方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.get_utc_date_time方法的具体用法?Python Utils.get_utc_date_time怎么用?Python Utils.get_utc_date_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.Utils
的用法示例。
在下文中一共展示了Utils.get_utc_date_time方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: import_files
# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import get_utc_date_time [as 别名]
def import_files(self, paths):
start_time = time.time()
netxml_files = self.find_all_netxml_files(paths)
if len(netxml_files) == 0:
print "No netxml files found to import."
else:
print "%s file(s) found to import." % str(len(netxml_files))
for netxml_file in netxml_files:
file_name = os.path.basename(netxml_file)
if self.ignore_already_imported_error == False and file_name in self.data_repository.imported_files:
imported_file = self.data_repository.imported_files[file_name]
print "Ignoring %s. It has already been imported on %s." % (netxml_file, str(imported_file.date_imported))
continue
print "Reading %s" % netxml_file
try:
tree = ElementTree.parse(netxml_file)
except:
print "Ignoring %s. Failed to parse the xml." % netxml_file
continue
root = tree.getroot()
self.parse_wireless_network_elements(root.findall("wireless-network"), file_name)
self.data_repository.imported_files[file_name] = ImportedFile(0, file_name, Utils.get_utc_date_time())
self.data_repository.save_updated_items()
end_time = time.time()
processing_time = end_time - start_time
print "Completed in %s secs." % str(round(processing_time,2))
示例2: import_files
# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import get_utc_date_time [as 别名]
def import_files(self, paths):
start_time = time.time()
pcap_files = self.find_all_pcap_files(paths)
if len(pcap_files) == 0:
print "No pcap files found to import."
else:
print "%s file(s) found to import." % str(len(pcap_files))
for pcap_file in pcap_files:
file_name = os.path.basename(pcap_file)
if self.ignore_already_imported_error == False and file_name in self.data_repository.imported_hostname_files:
imported_file = self.data_repository.imported_hostname_files[file_name]
print "Ignoring %s. It has already been imported on %s." % (pcap_file, str(imported_file.date_imported))
continue
print "Reading %s" % pcap_file
self.parse_pcap_file(pcap_file)
self.data_repository.imported_hostname_files[file_name] = ImportedHostnameFile(0, file_name, Utils.get_utc_date_time())
self.data_repository.save_updated_items()
end_time = time.time()
processing_time = end_time - start_time
print "Completed in %s secs." % str(round(processing_time,2))