Browse Source

int2long 被 tools.ensure_int64 替换

dongzhaorui 1 năm trước cách đây
mục cha
commit
e97c01a3b1
2 tập tin đã thay đổi với 4 bổ sung5 xóa
  1. 3 3
      FworkSpider/items/njpc_item.py
  2. 1 2
      FworkSpider/items/spider_item.py

+ 3 - 3
FworkSpider/items/njpc_item.py

@@ -4,7 +4,7 @@ import feapder.utils.tools as tools
 from feapder import BaseListItem, BaseDetailItem
 from feapder.utils.log import log
 from untils.check_data import CheckData
-from untils.tools import int2long, substitute, text_search
+from untils.tools import substitute, text_search
 
 
 class DataNjpcItem(BaseDetailItem):
@@ -119,7 +119,7 @@ class DataNjpcItem(BaseDetailItem):
                 raise ValueError("发布时间格式不正确 -> %r " % self.publishtime)
 
         # 时间字符串转时间戳
-        self.publishtime = int2long(tools.date_to_timestamp(publishtime))
+        self.publishtime = tools.ensure_int64(tools.date_to_timestamp(publishtime))
 
     def handle_publish_time_overdue(self):
         """超期发布时间处理"""
@@ -128,7 +128,7 @@ class DataNjpcItem(BaseDetailItem):
 
         if self.publishtime > self.comeintime:
             log.warning("发布时间大于当前时间,已设置当前时间为发布时间!")
-            self.publishtime = int2long(tools.get_current_timestamp())
+            self.publishtime = tools.ensure_int64(tools.get_current_timestamp())
 
     def handle_page_html(self):
         if not self.contenthtml:

+ 1 - 2
FworkSpider/items/spider_item.py

@@ -5,7 +5,6 @@ from feapder import BaseListItem, BaseDetailItem
 from feapder.utils.log import log
 from untils.check_data import CheckData
 from untils.tools import (
-    int2long,
     substitute,
     text_search,
 )
@@ -84,7 +83,7 @@ class DataBakItem(BaseDetailItem):
         if self.l_np_publishtime and self.l_np_publishtime > self.comeintime:
             log.warning("发布时间大于当前时间,已设置当前时间为发布时间!")
             self.publishtime = tools.get_current_date()
-            self.l_np_publishtime = int2long(tools.date_to_timestamp(self.publishtime))
+            self.l_np_publishtime = tools.ensure_int64(tools.date_to_timestamp(self.publishtime))
 
     def handle_page_html(self):
         if not self.contenthtml: