Improve plugin update.
This commit is contained in:
parent
ef878eed7c
commit
23e6a8923d
9 changed files with 115 additions and 82 deletions
|
@ -4,6 +4,7 @@
|
|||
Script to get arcamax comics and save the info in a JSON file for further processing.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import codecs
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
|
@ -75,14 +76,17 @@ def has_comic(name):
|
|||
|
||||
def print_results(args):
|
||||
"""Print all comics that have at least the given number of minimum comic strips."""
|
||||
for name, shortname in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
if has_comic(name):
|
||||
prefix = '#'
|
||||
else:
|
||||
prefix = ''
|
||||
print("%sadd(%r, %r)" % (prefix, str(truncate_name(name)), str(shortname)))
|
||||
min_comics, filename = args
|
||||
with codecs.open(filename, 'a', 'utf-8') as fp:
|
||||
for name, shortname in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
if has_comic(name):
|
||||
prefix = u'#'
|
||||
else:
|
||||
prefix = u''
|
||||
fp.write(u"%sadd(%r, %r)\n" % (prefix, str(truncate_name(name)),
|
||||
str(shortname)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
Script to get arcamax comics and save the info in a JSON file for further processing.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import codecs
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
|
@ -296,20 +297,22 @@ def has_comic(name):
|
|||
|
||||
def print_results(args):
|
||||
"""Print all comics that have at least the given number of minimum comic strips."""
|
||||
min_comics = int(args[0])
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
url, desc, num, genre, active = entry
|
||||
if num < min_comics:
|
||||
continue
|
||||
if has_comic(name):
|
||||
prefix = '#'
|
||||
else:
|
||||
prefix = ''
|
||||
print("%sadd(%r, %r, %r)" % (
|
||||
prefix, str(truncate_name(name)), str(url), desc
|
||||
))
|
||||
min_comics, filename = args
|
||||
min_comics = int(min_comics)
|
||||
with codecs.open(filename, 'a', 'utf-8') as fp:
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
url, desc, num, genre, active = entry
|
||||
if num < min_comics:
|
||||
continue
|
||||
if has_comic(name):
|
||||
prefix = u'#'
|
||||
else:
|
||||
prefix = u''
|
||||
fp.write(u"%sadd(%r, %r, %r)\n" % (
|
||||
prefix, str(truncate_name(name)), str(url), desc
|
||||
))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -5,6 +5,7 @@ Script to get a list of ComicGenesis comics and save the info in a
|
|||
JSON file for further processing.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import codecs
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
|
@ -429,19 +430,23 @@ def has_comic(name):
|
|||
|
||||
def print_results(args):
|
||||
"""Print all comics that have at least the given number of minimum comic strips."""
|
||||
min_comics = int(args[0])
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
url, num = entry
|
||||
if num < min_comics:
|
||||
continue
|
||||
url = url.replace("comicgen.com", "comicgenesis.com")
|
||||
if has_comic(name):
|
||||
prefix = '#'
|
||||
else:
|
||||
prefix = ''
|
||||
print("%sadd(%r, %r)" % (prefix, str(truncate_name(name)), str(url)))
|
||||
min_comics, filename = args
|
||||
min_comics = int(min_comics)
|
||||
with codecs.open(filename, 'a', 'utf-8') as fp:
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
url, num = entry
|
||||
if num < min_comics:
|
||||
continue
|
||||
url = url.replace("comicgen.com", "comicgenesis.com")
|
||||
if has_comic(name):
|
||||
prefix = u'#'
|
||||
else:
|
||||
prefix = u''
|
||||
fp.write(u"%sadd(%r, %r)\n" % (
|
||||
prefix, str(truncate_name(name)), str(url))
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -5,6 +5,7 @@ Script to get a list of creators.com comics and save the info in a JSON file for
|
|||
"""
|
||||
from __future__ import print_function
|
||||
import re
|
||||
import codecs
|
||||
import sys
|
||||
import os
|
||||
import requests
|
||||
|
@ -64,14 +65,18 @@ def has_gocomics_comic(name):
|
|||
|
||||
def print_results(args):
|
||||
"""Print comics."""
|
||||
for name, url in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
if has_gocomics_comic(name):
|
||||
prefix = '# duplicate of gocomics '
|
||||
else:
|
||||
prefix = ''
|
||||
print("%sadd(%r, %r)" % (prefix, str(truncate_name(name)), str(url)))
|
||||
min_comics, filename = args
|
||||
with codecs.open(filename, 'a', 'utf-8') as fp:
|
||||
for name, url in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
if has_gocomics_comic(name):
|
||||
prefix = u'# duplicate of gocomics '
|
||||
else:
|
||||
prefix = u''
|
||||
fp.write(u"%sadd(%r, %r)\n" % (
|
||||
prefix, str(truncate_name(name)), str(url))
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
Script to get a list of drunkduck comics and save the info in a JSON file for further processing.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import codecs
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
|
@ -205,18 +206,22 @@ def get_results():
|
|||
save_result(res, json_file)
|
||||
|
||||
|
||||
def print_results(min_strips):
|
||||
def print_results(args):
|
||||
"""Print all comics that have at least the given number of minimum comic strips."""
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
path, num = entry
|
||||
if num >= min_strips:
|
||||
print("add(%r, %r)" % (str(truncate_name(name)), str(path)))
|
||||
min_comics, filename = args
|
||||
min_comics = int(min_comics)
|
||||
with codecs.open(filename, 'a', 'utf-8') as fp:
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
path, num = entry
|
||||
if num >= min_comics:
|
||||
fp.write(u"add(%r, %r)\n" % (
|
||||
str(truncate_name(name)), str(path)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) > 1:
|
||||
print_results(int(sys.argv[1]))
|
||||
print_results(sys.argv[1:])
|
||||
else:
|
||||
get_results()
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
Script to get a list of gocomics and save the info in a JSON file for further processing.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import codecs
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
|
@ -97,10 +98,14 @@ def get_results():
|
|||
|
||||
def print_results(args):
|
||||
"""Print all comics that have at least the given number of minimum comic strips."""
|
||||
for name, shortname in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
print("add(%r, %r)" % (str(truncate_name(name)), str(shortname)))
|
||||
min_comics, filename = args
|
||||
with codecs.open(filename, 'a', 'utf-8') as fp:
|
||||
for name, shortname in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
fp.write(u"add(%r, %r)\n" % (
|
||||
str(truncate_name(name)), str(shortname))
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -5,6 +5,7 @@ Script to get a list of KeenSpot comics and save the info in a
|
|||
JSON file for further processing.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import codecs
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
|
@ -122,18 +123,20 @@ def has_comic(name):
|
|||
|
||||
def print_results(args):
|
||||
"""Print all comics."""
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
url, desc = entry
|
||||
if has_comic(name):
|
||||
prefix = '#'
|
||||
else:
|
||||
prefix = ''
|
||||
name = truncate_name(name).encode('utf-8')
|
||||
url = url.encode('utf-8')
|
||||
desc = desc.encode('utf-8')
|
||||
print("%sadd(%r, %r, %r)" % (prefix, name, url, desc))
|
||||
min_comics, filename = args
|
||||
with codecs.open(filename, 'a', 'utf-8') as fp:
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
url, desc = entry
|
||||
if has_comic(name):
|
||||
prefix = u'#'
|
||||
else:
|
||||
prefix = u''
|
||||
name = truncate_name(name)
|
||||
fp.write(u"%sadd(%r, %r, %r)\n" % (
|
||||
prefix, str(name), str(url), desc)
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
Script to get a list of smackjeeves.com comics and save the info in a JSON file for further processing.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import codecs
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
|
@ -317,20 +318,22 @@ def has_comic(name):
|
|||
|
||||
def print_results(args):
|
||||
"""Print all comics that have at least the given number of minimum comic strips."""
|
||||
min_comics = int(args[0])
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
url, num, desc, adult, bounce = entry
|
||||
if num < min_comics:
|
||||
continue
|
||||
if has_comic(name):
|
||||
prefix = '#'
|
||||
else:
|
||||
prefix = ''
|
||||
print("%sadd(%r, %r, %r, %s, %s)" % (
|
||||
prefix, str(truncate_name(name)), str(url), desc, adult, bounce
|
||||
))
|
||||
min_comics, filename = args
|
||||
min_comics = int(min_comics)
|
||||
with codecs.open(filename, 'a', 'utf-8') as fp:
|
||||
for name, entry in sorted(load_result(json_file).items()):
|
||||
if name in exclude_comics:
|
||||
continue
|
||||
url, num, desc, adult, bounce = entry
|
||||
if num < min_comics:
|
||||
continue
|
||||
if has_comic(name):
|
||||
prefix = u'#'
|
||||
else:
|
||||
prefix = u''
|
||||
fp.write(u"%sadd(%r, %r, %r, %s, %s)\n" % (
|
||||
prefix, str(truncate_name(name)), str(url), desc, adult, bounce
|
||||
))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -15,5 +15,5 @@ for script in $list; do
|
|||
target="${d}/../dosagelib/plugins/${script}.py"
|
||||
echo "Upating $target"
|
||||
"${d}/removeafter.py" "$target" "# DO NOT REMOVE"
|
||||
"${d}/${script}.py" $mincomics >> "$target"
|
||||
"${d}/${script}.py" $mincomics "$target"
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue