From e31fb49320a5a2af0232b98ed509623db8a9b4c0 Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Sat, 1 Feb 2014 17:38:31 -0200 Subject: [PATCH] make 'basic' the default template spider in genspider, and added info with next steps to startproject. closes #488 --- scrapy/commands/genspider.py | 2 +- scrapy/commands/startproject.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scrapy/commands/genspider.py b/scrapy/commands/genspider.py index 21b5ba3ea..3e2e24b21 100644 --- a/scrapy/commands/genspider.py +++ b/scrapy/commands/genspider.py @@ -40,7 +40,7 @@ class Command(ScrapyCommand): help="Edit spider after creating it") parser.add_option("-d", "--dump", dest="dump", metavar="TEMPLATE", help="Dump template to standard output") - parser.add_option("-t", "--template", dest="template", default="crawl", + parser.add_option("-t", "--template", dest="template", default="basic", help="Uses a custom template.") parser.add_option("--force", dest="force", action="store_true", help="If the spider already exists, overwrite it with the template") diff --git a/scrapy/commands/startproject.py b/scrapy/commands/startproject.py index eeb04cda9..c266f75c4 100644 --- a/scrapy/commands/startproject.py +++ b/scrapy/commands/startproject.py @@ -3,7 +3,7 @@ import sys import string import re import shutil -from os.path import join, exists +from os.path import join, exists, abspath from shutil import copytree, ignore_patterns import scrapy @@ -53,3 +53,8 @@ class Command(ScrapyCommand): string.Template(path).substitute(project_name=project_name)) render_templatefile(tplfile, project_name=project_name, ProjectName=string_camelcase(project_name)) + print("New Scrapy project %r created in:" % project_name) + print(" %s\n" % abspath(project_name)) + print("You can start your first spider with:") + print(" cd %s" % project_name) + print(" scrapy genspider example example.com")