From 8e75b465bfac138f9b6bb34b3f3cdc31ffcd7be6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 24 Nov 2009 21:01:28 -0700 Subject: [PATCH] IGN:Various changes for the migration to calibre-ebook.com --- Changelog.yaml | 24 +++++++-------- setup/check.py | 8 ++++- setup/commands.py | 5 ++- setup/publish.py | 77 ++--------------------------------------------- setup/upload.py | 3 +- 5 files changed, 24 insertions(+), 93 deletions(-) diff --git a/Changelog.yaml b/Changelog.yaml index b47bdb867b..874d090d84 100644 --- a/Changelog.yaml +++ b/Changelog.yaml @@ -9,10 +9,10 @@ new features: - title: Add option to swap title and author in the Bulk metadata dialog - tickets: #3885 + tickets: [3885] - title: Add option to download only social metadata - tickets: #4015 + tickets: [4015] - title: Update bundled odfpy library to 0.9.2 for improved conversion of ODT files. @@ -29,18 +29,18 @@ ignore the files whose names it cannot decode. - title: Fix various bugs in the downloading of social metadata in bulk - tickets: #4028, #4022 + tickets: [4028, 4022] - title: Do not URL encode paths to files in the XML output of calibredb list description: Stanza on the iPhone could not handle URL encoded paths - title: Fix rendering of stars in rating column in the library view - tickets: #3944 + tickets: [3944] - title: Fix PML parsing changes introduced in 0.6.22 as they break PDB eReader input badly. - title: "Conversion pipeline: Respect UTF-8/32 BOM mark when decoding files in addition to UTF-16 BOM." - tickets: #4025 + tickets: [4025] - title: Restore all sections to Guardian newspaper download @@ -62,13 +62,13 @@ new features: - title: Support downloading of social metadata (ratings/tags/reviews etc.) - - description: > + description: > calibre is now able to download social metadata like tags/rating/reviews etc., in addition to normal metadata and covers. Currently it uses Amazon as the only source for social metadata, but the download system supports plugins for the addition of more sources in the future. type: major - tickets: #2860 + tickets: [2860] - title: Convert metadata download system to plugins, with builtin plugins for isbndb.com, Google Books and Amazon @@ -78,18 +78,18 @@ bug fixes: - title: Fix NYT Top stories, Barrons, New Scientist and Irish Times recipes - tickets: #4009, #3964, #3972, #3987 + tickets: [4009, 3964, 3972, 3987] - title: "FB2 Output: Handle large paragraphs" - tickets: #3941 + tickets: [3941] - title: "Bulk metadata download: Don't fail on downloading all remaining covers if there is an error downloading a single cover in the list" - title: Populate site_customization for Input plugins - tickets: #3957 + tickets: [3957] - title: Fix news download scheduler raising an error for scheduled custom recipe that is subsequently deleted - tickets: #4010 + tickets: [4010] @@ -101,7 +101,7 @@ author: Oliver Niesner - title: An Druma Mor - - author: "David O'Callaghan" + author: "David O'Callaghan" improved recipes: - Critica Digital diff --git a/setup/check.py b/setup/check.py index 86df693b68..fa7ab9d111 100644 --- a/setup/check.py +++ b/setup/check.py @@ -75,7 +75,13 @@ class Check(Command): raise SystemExit(1) cache[f] = mtime cPickle.dump(cache, open(self.CACHE, 'wb'), -1) - + wn_path = os.path.expanduser('~/work/servers/src/calibre_servers/main') + if os.path.exists(wn_path): + sys.path.insert(0, wn_path) + self.info('\tChecking Changelog...') + import whats_new + whats_new.test() + sys.path.remove(wn_path) def report_errors(self, errors): for err in errors: diff --git a/setup/commands.py b/setup/commands.py index 650d88b5cd..d5687bb1d5 100644 --- a/setup/commands.py +++ b/setup/commands.py @@ -14,7 +14,7 @@ __all__ = [ 'resources', 'check', 'sdist', - 'manual', 'tag_release', 'upload_rss', + 'manual', 'tag_release', 'pypi_register', 'pypi_upload', 'upload_to_server', 'upload_user_manual', 'upload_to_mobileread', 'upload_demo', 'upload_to_sourceforge', 'upload_to_google_code', @@ -49,11 +49,10 @@ check = Check() from setup.resources import Resources resources = Resources() -from setup.publish import Manual, TagRelease, UploadRss, Stage1, Stage2, \ +from setup.publish import Manual, TagRelease, Stage1, Stage2, \ Stage3, Stage4, Publish manual = Manual() tag_release = TagRelease() -upload_rss = UploadRss() stage1 = Stage1() stage2 = Stage2() stage3 = Stage3() diff --git a/setup/publish.py b/setup/publish.py index bc42b07346..599c881be3 100644 --- a/setup/publish.py +++ b/setup/publish.py @@ -6,8 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import sys, os, shutil, subprocess, re, time, glob -from datetime import datetime +import os, shutil, subprocess, glob from setup import Command, __appname__, __version__ @@ -43,7 +42,7 @@ class Stage2(Command): class Stage3(Command): description = 'Stage 3 of the publish process' - sub_commands = ['upload_rss', 'upload_user_manual', 'upload_demo', 'sdist', + sub_commands = ['upload_user_manual', 'upload_demo', 'sdist', 'upload_to_google_code', 'tag_release', 'upload_to_server', 'upload_to_sourceforge', 'upload_to_mobileread', ] @@ -99,76 +98,4 @@ class TagRelease(Command): subprocess.check_call(('bzr tag '+__version__).split()) subprocess.check_call('bzr commit --unchanged -m'.split() + ['IGN:Tag release']) -try: - class UploadRss(Command): - description = 'Generate and upload a RSS feed of calibre releases' - - from bzrlib import log as blog - - class ChangelogFormatter(blog.LogFormatter): - supports_tags = True - supports_merge_revisions = False - _show_advice = False - - def __init__(self, num_of_versions=20): - sys.path.insert(0, os.path.join(Command.SRC, 'calibre', 'utils')) - from rss_gen import RSS2 - self.num_of_versions = num_of_versions - self.rss = RSS2( - title = 'calibre releases', - link = 'http://calibre.kovidgoyal.net/wiki/Changelog', - description = 'Latest release of calibre', - lastBuildDate = datetime.utcnow() - ) - self.current_entry = None - - def log_revision(self, r): - from rss_gen import RSSItem, Guid - if len(self.rss.items) > self.num_of_versions-1: - return - msg = r.rev.message - match = re.match(r'version\s+(\d+\.\d+.\d+)', msg) - - if match: - if self.current_entry is not None: - mkup = '
    %s
' - self.current_entry.description = mkup%(''.join( - self.current_entry.description)) - if match.group(1) == '0.5.14': - self.current_entry.description = \ - '''
See New in - 6
''' - self.rss.items.append(self.current_entry) - timestamp = r.rev.timezone + r.rev.timestamp - self.current_entry = RSSItem( - title = 'calibre %s released'%match.group(1), - link = 'http://calibre.kovidgoyal.net/download', - guid = Guid(match.group(), False), - pubDate = datetime(*time.gmtime(timestamp)[:6]), - description = [] - ) - elif self.current_entry is not None: - if re.search(r'[a-zA-Z]', msg) and len(msg.strip()) > 5: - if 'translation' not in msg and not msg.startswith('IGN'): - msg = msg.replace('<', '<').replace('>', '>') - msg = re.sub('#(\d+)', r'#\1', - msg) - - self.current_entry.description.append( - '
  • %s
  • '%msg.strip()) - - - def run(self, opts): - from bzrlib import log, branch - bzr_path = os.path.expanduser('~/work/calibre') - b = branch.Branch.open(bzr_path) - lf = UploadRss.ChangelogFormatter() - self.info('\tGenerating bzr log...') - log.show_log(b, lf) - lf.rss.write_xml(open('/tmp/releases.xml', 'wb')) - self.info('\tUploading RSS to server...') - subprocess.check_call('scp /tmp/releases.xml divok:/var/www/calibre.kovidgoyal.net/htdocs/downloads'.split()) -except ImportError: - class UploadRss(Command): - description = 'You need bzr installed to use this command' diff --git a/setup/upload.py b/setup/upload.py index 545ec5c97f..dcb988f883 100644 --- a/setup/upload.py +++ b/setup/upload.py @@ -12,10 +12,9 @@ from tempfile import NamedTemporaryFile from setup import Command, __version__, installer_name, __appname__ -PREFIX = "/var/www/calibre.kovidgoyal.net" +PREFIX = "/var/www/calibre-ebook.com" DOWNLOADS = PREFIX+"/htdocs/downloads" BETAS = DOWNLOADS +'/betas' -DOCS = PREFIX+"/htdocs/apidocs" USER_MANUAL = PREFIX+'/htdocs/user_manual' HTML2LRF = "calibre/ebooks/lrf/html/demo" TXT2LRF = "src/calibre/ebooks/lrf/txt/demo"