Skip to content

Commit e8ee449

Browse files
committed
Merge pull request scrapy#432 from darkrho/crawl-url
Removed URL reference in crawl command and .tld suffix in docs for spider names
2 parents 62fd5b3 + 34543c2 commit e8ee449

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

docs/intro/overview.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Finally, here's the spider code::
137137

138138
class MininovaSpider(CrawlSpider):
139139

140-
name = 'mininova.org'
140+
name = 'mininova'
141141
allowed_domains = ['mininova.org']
142142
start_urls = ['http://www.mininova.org/today']
143143
rules = [Rule(SgmlLinkExtractor(allow=['/tor/\d+']), 'parse_torrent')]
@@ -160,7 +160,7 @@ Run the spider to extract the data
160160
Finally, we'll run the spider to crawl the site an output file
161161
``scraped_data.json`` with the scraped data in JSON format::
162162

163-
scrapy crawl mininova.org -o scraped_data.json -t json
163+
scrapy crawl mininova -o scraped_data.json -t json
164164

165165
This uses :ref:`feed exports <topics-feed-exports>` to generate the JSON file.
166166
You can easily change the export format (XML or CSV, for example) or the

docs/topics/settings.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Settings attribute.
5656

5757
Example::
5858

59-
scrapy crawl domain.com -s LOG_FILE=scrapy.log
59+
scrapy crawl myspider -s LOG_FILE=scrapy.log
6060

6161
2. Project settings module
6262
--------------------------

scrapy/command.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Base class for Scrapy commands
33
"""
4-
54
import os
65
import warnings
76
from optparse import OptionGroup
@@ -10,6 +9,7 @@
109
from scrapy.utils.conf import arglist_to_dict
1110
from scrapy.exceptions import UsageError, ScrapyDeprecationWarning
1211

12+
1313
class ScrapyCommand(object):
1414

1515
requires_project = False
@@ -21,7 +21,7 @@ class ScrapyCommand(object):
2121
exitcode = 0
2222

2323
def __init__(self):
24-
self.settings = None # set in scrapy.cmdline
24+
self.settings = None # set in scrapy.cmdline
2525

2626
def set_crawler(self, crawler):
2727
assert not hasattr(self, '_crawler'), "crawler already set"
@@ -38,12 +38,14 @@ def crawler(self):
3838

3939
old_start = crawler.start
4040
self.crawler_process.started = False
41+
4142
def wrapped_start():
4243
if self.crawler_process.started:
4344
old_start()
4445
else:
4546
self.crawler_process.started = True
4647
self.crawler_process.start()
48+
4749
crawler.start = wrapped_start
4850

4951
self.set_crawler(crawler)
@@ -81,22 +83,22 @@ def add_options(self, parser):
8183
Populate option parse with options available for this command
8284
"""
8385
group = OptionGroup(parser, "Global Options")
84-
group.add_option("--logfile", metavar="FILE", \
86+
group.add_option("--logfile", metavar="FILE",
8587
help="log file. if omitted stderr will be used")
86-
group.add_option("-L", "--loglevel", metavar="LEVEL", \
87-
default=None, \
88+
group.add_option("-L", "--loglevel", metavar="LEVEL", default=None,
8889
help="log level (default: %s)" % self.settings['LOG_LEVEL'])
89-
group.add_option("--nolog", action="store_true", \
90+
group.add_option("--nolog", action="store_true",
9091
help="disable logging completely")
91-
group.add_option("--profile", metavar="FILE", default=None, \
92+
group.add_option("--profile", metavar="FILE", default=None,
9293
help="write python cProfile stats to FILE")
93-
group.add_option("--lsprof", metavar="FILE", default=None, \
94+
group.add_option("--lsprof", metavar="FILE", default=None,
9495
help="write lsprof profiling stats to FILE")
95-
group.add_option("--pidfile", metavar="FILE", \
96+
group.add_option("--pidfile", metavar="FILE",
9697
help="write process ID to FILE")
97-
group.add_option("-s", "--set", action="append", default=[], metavar="NAME=VALUE", \
98+
group.add_option("-s", "--set", action="append", default=[], metavar="NAME=VALUE",
9899
help="set/override setting (may be repeated)")
99100
group.add_option("--pdb", action="store_true", help="enable pdb on failure")
101+
100102
parser.add_option_group(group)
101103

102104
def process_options(self, args, opts):

scrapy/commands/crawl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def syntax(self):
1010
return "[options] <spider>"
1111

1212
def short_desc(self):
13-
return "Start crawling from a spider or URL"
13+
return "Start crawling from a spider"
1414

1515
def add_options(self, parser):
1616
ScrapyCommand.add_options(self, parser)

0 commit comments

Comments
 (0)