Browse Source

Clean imports in code

In some part in the code we import objects. In the Openstack style guidelines
they recommend to import only modules. [1]: "Do not import objects, only modules".

[1] https://docs.openstack.org/hacking/0.10.3/

Change-Id: I49452e41f9674e6ebfcc1577d59d21750e957677
Nguyen Hung Phuong 1 year ago
parent
commit
8625096bce
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      sitemap/generator/spiders/sitemap_file.py

+ 2
- 2
sitemap/generator/spiders/sitemap_file.py View File

@@ -18,7 +18,7 @@ except ImportError:
18 18
     import urllib.parse as urlparse
19 19
 
20 20
 from scrapy import item
21
-from scrapy.linkextractors import LinkExtractor
21
+from scrapy import linkextractors
22 22
 from scrapy import spiders
23 23
 
24 24
 
@@ -43,7 +43,7 @@ class SitemapSpider(spiders.CrawlSpider):
43 43
 
44 44
     rules = [
45 45
         spiders.Rule(
46
-            LinkExtractor(
46
+            linkextractors.LinkExtractor(
47 47
                 allow=[
48 48
                     r'.*\.html',
49 49
                     r'.*\.pdf',

Loading…
Cancel
Save