rename a few files
This commit is contained in:
@@ -16,7 +16,7 @@ __email__ = "mike_faehrmann@web.de"
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
from . import config, extractor, jobs
|
from . import config, extractor, job
|
||||||
|
|
||||||
def build_cmdline_parser():
|
def build_cmdline_parser():
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
@@ -81,11 +81,11 @@ def main():
|
|||||||
if not args.urls:
|
if not args.urls:
|
||||||
parser.error("the following arguments are required: URL")
|
parser.error("the following arguments are required: URL")
|
||||||
if args.list_urls:
|
if args.list_urls:
|
||||||
jobtype = jobs.UrlJob
|
jobtype = job.UrlJob
|
||||||
elif args.list_keywords:
|
elif args.list_keywords:
|
||||||
jobtype = jobs.KeywordJob
|
jobtype = job.KeywordJob
|
||||||
else:
|
else:
|
||||||
jobtype = jobs.DownloadJob
|
jobtype = job.DownloadJob
|
||||||
for url in args.urls:
|
for url in args.urls:
|
||||||
jobtype(url).run()
|
jobtype(url).run()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
from . import config, extractor, downloader, text, output, exceptions
|
from . import config, extractor, downloader, text, output, exception
|
||||||
from .extractor.message import Message
|
from .extractor.message import Message
|
||||||
|
|
||||||
class Job():
|
class Job():
|
||||||
@@ -18,7 +18,7 @@ class Job():
|
|||||||
def __init__(self, url):
|
def __init__(self, url):
|
||||||
self.extractor = extractor.find(url)
|
self.extractor = extractor.find(url)
|
||||||
if self.extractor is None:
|
if self.extractor is None:
|
||||||
raise exceptions.NoExtractorError(url)
|
raise exception.NoExtractorError(url)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Execute or run the job"""
|
"""Execute or run the job"""
|
||||||
@@ -80,7 +80,7 @@ class DownloadJob(Job):
|
|||||||
for url in self.queue:
|
for url in self.queue:
|
||||||
try:
|
try:
|
||||||
DownloadJob(url).run()
|
DownloadJob(url).run()
|
||||||
except exceptions.NoExtractorError:
|
except exception.NoExtractorError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def download(self, msg):
|
def download(self, msg):
|
||||||
Reference in New Issue
Block a user