/usr/share/pyshared/scrapy/commands/settings.py is in python-scrapy 0.14.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | from scrapy.command import ScrapyCommand
class Command(ScrapyCommand):
requires_project = False
default_settings = {'LOG_ENABLED': False}
def syntax(self):
return "[options]"
def short_desc(self):
return "Get settings values"
def add_options(self, parser):
ScrapyCommand.add_options(self, parser)
parser.add_option("--get", dest="get", metavar="SETTING", \
help="print raw setting value")
parser.add_option("--getbool", dest="getbool", metavar="SETTING", \
help="print setting value, intepreted as a boolean")
parser.add_option("--getint", dest="getint", metavar="SETTING", \
help="print setting value, intepreted as an integer")
parser.add_option("--getfloat", dest="getfloat", metavar="SETTING", \
help="print setting value, intepreted as an float")
parser.add_option("--getlist", dest="getlist", metavar="SETTING", \
help="print setting value, intepreted as an float")
def run(self, args, opts):
settings = self.crawler.settings
if opts.get:
print settings.get(opts.get)
elif opts.getbool:
print settings.getbool(opts.getbool)
elif opts.getint:
print settings.getint(opts.getint)
elif opts.getfloat:
print settings.getfloat(opts.getfloat)
elif opts.getlist:
print settings.getlist(opts.getlist)
|