diff --git a/.gitignore b/.gitignore index 4ae04fdb..9ed88b9b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ cleanup.sh FanFictionDownLoader.zip *.epub *Thumbs.db +FanFicFare.zip +output diff --git a/calibre-plugin/__init__.py b/calibre-plugin/__init__.py index 7f063e4c..f8308550 100644 --- a/calibre-plugin/__init__.py +++ b/calibre-plugin/__init__.py @@ -12,7 +12,7 @@ if sys.version_info >= (2, 7): import logging logger = logging.getLogger(__name__) loghandler=logging.StreamHandler() - loghandler.setFormatter(logging.Formatter("FFDL:%(levelname)s:%(filename)s(%(lineno)d):%(message)s")) + loghandler.setFormatter(logging.Formatter("FFF:%(levelname)s:%(filename)s(%(lineno)d):%(message)s")) logger.addHandler(loghandler) loghandler.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG) @@ -28,7 +28,7 @@ from calibre.customize import InterfaceActionBase ## Apparently the name for this class doesn't matter--it was still ## 'demo' for the first few versions. -class FanFictionDownLoaderBase(InterfaceActionBase): +class FanFicFareBase(InterfaceActionBase): ''' This class is a simple wrapper that provides information about the actual plugin class. The actual interface plugin class is called @@ -38,7 +38,7 @@ class FanFictionDownLoaderBase(InterfaceActionBase): The reason for having two classes is that it allows the command line calibre utilities to run without needing to load the GUI libraries. ''' - name = 'FanFictionDownLoader' + name = 'FanFicFare' description = _('UI plugin to download FanFiction stories from various sites.') supported_platforms = ['windows', 'osx', 'linux'] author = 'Jim Miller' @@ -48,7 +48,7 @@ class FanFictionDownLoaderBase(InterfaceActionBase): #: This field defines the GUI plugin class that contains all the code #: that actually does something. Its format is module_path:class_name #: The specified class must be defined in the specified module. - actual_plugin = 'calibre_plugins.fanfictiondownloader_plugin.ffdl_plugin:FanFictionDownLoaderPlugin' + actual_plugin = 'calibre_plugins.fanficfare_plugin.ffdl_plugin:FanFicFarePlugin' def is_customizable(self): ''' @@ -79,7 +79,7 @@ class FanFictionDownLoaderBase(InterfaceActionBase): # top of the module as importing the config class will also cause the # GUI libraries to be loaded, which we do not want when using calibre # from the command line - from calibre_plugins.fanfictiondownloader_plugin.config import ConfigWidget + from calibre_plugins.fanficfare_plugin.config import ConfigWidget return ConfigWidget(self.actual_plugin_) def save_settings(self, config_widget): @@ -107,8 +107,8 @@ class FanFictionDownLoaderBase(InterfaceActionBase): # CLI--it would load everytime anyway. from StringIO import StringIO from calibre.library import db - from calibre_plugins.fanfictiondownloader_plugin.downloader import main as ffdl_main - from calibre_plugins.fanfictiondownloader_plugin.prefs import PrefsFacade + from calibre_plugins.fanficfare_plugin.downloader import main as ffdl_main + from calibre_plugins.fanficfare_plugin.prefs import PrefsFacade from calibre.utils.config import prefs as calibre_prefs from optparse import OptionParser diff --git a/calibre-plugin/common_utils.py b/calibre-plugin/common_utils.py index 73ac823c..2210bdb7 100644 --- a/calibre-plugin/common_utils.py +++ b/calibre-plugin/common_utils.py @@ -118,7 +118,7 @@ def create_menu_item(ia, parent_menu, menu_text, image=None, tooltip=None, if len(shortcut) == 0: shortcut = () else: - shortcut = _(shortcut) + shortcut = shortcut ac = ia.create_action(spec=(menu_text, None, tooltip, shortcut), attr=menu_text) if image: @@ -155,7 +155,7 @@ def create_menu_action_unique(ia, parent_menu, menu_text, image=None, tooltip=No if len(shortcut) == 0: shortcut = None else: - shortcut = _(shortcut) + shortcut = shortcut if shortcut_name is None: shortcut_name = menu_text.replace('&','') @@ -393,9 +393,9 @@ class KeyboardConfigDialog(SizePersistedDialog): This dialog is used to allow editing of keyboard shortcuts. ''' def __init__(self, gui, group_name): - SizePersistedDialog.__init__(self, gui, 'Keyboard shortcut dialog') + SizePersistedDialog.__init__(self, gui, 'FanFicFare plugin:Keyboard shortcut dialog') self.gui = gui - self.setWindowTitle('Keyboard shortcuts') + self.setWindowTitle(_('Keyboard shortcuts')) layout = QVBoxLayout(self) self.setLayout(layout) @@ -461,8 +461,8 @@ class DateDelegate(QStyledItemDelegate): class PrefsViewerDialog(SizePersistedDialog): def __init__(self, gui, namespace): - SizePersistedDialog.__init__(self, gui, 'Prefs Viewer dialog') - self.setWindowTitle('Preferences for: '+namespace) + SizePersistedDialog.__init__(self, gui, _('Prefs Viewer dialog')) + self.setWindowTitle(_('Preferences for: ')+namespace) self.gui = gui self.db = gui.current_db @@ -494,9 +494,9 @@ class PrefsViewerDialog(SizePersistedDialog): button_box = QDialogButtonBox(QDialogButtonBox.Ok) button_box.accepted.connect(self.accept) - self.clear_button = button_box.addButton('Clear', QDialogButtonBox.ResetRole) + self.clear_button = button_box.addButton(_('Clear'), QDialogButtonBox.ResetRole) self.clear_button.setIcon(get_icon('trash.png')) - self.clear_button.setToolTip('Clear all settings for this plugin') + self.clear_button.setToolTip(_('Clear all settings for this plugin')) self.clear_button.clicked.connect(self._clear_settings) layout.addWidget(button_box) @@ -523,10 +523,9 @@ class PrefsViewerDialog(SizePersistedDialog): def _clear_settings(self): from calibre.gui2.dialogs.confirm_delete import confirm - message = '

Are you sure you want to clear your settings in this library for this plugin?

' \ - '

Any settings in other libraries or stored in a JSON file in your calibre plugins ' \ - 'folder will not be touched.

' \ - '

You must restart calibre afterwards.

' + message = '

' + _('Are you sure you want to clear your settings in this library for this plugin?') + '

' \ + + '

' + _('Any settings in other libraries or stored in a JSON file in your calibre plugins folder will not be touched.') + '

' \ + + '

' + _('You must restart calibre afterwards.') + '

' if not confirm(message, self.namespace+'_clear_settings', self): return ns_prefix = self._get_ns_prefix() @@ -535,8 +534,8 @@ class PrefsViewerDialog(SizePersistedDialog): del self.db.prefs[k] self._populate_settings() d = info_dialog(self, 'Settings deleted', - '

All settings for this plugin in this library have been cleared.

' - '

Please restart calibre now.

', + '

' + _('All settings for this plugin in this library have been cleared.') + '

' \ + + '

' + _('Please restart calibre now.') + '

', show_copy_button=False) b = d.bb.addButton(_('Restart calibre now'), d.bb.AcceptRole) b.setIcon(QIcon(I('lt.png'))) diff --git a/calibre-plugin/config.py b/calibre-plugin/config.py index 3ee1579d..e3face41 100644 --- a/calibre-plugin/config.py +++ b/calibre-plugin/config.py @@ -70,18 +70,18 @@ no_trans = { 'pini':'personal.ini', 'p':'password', } -from calibre_plugins.fanfictiondownloader_plugin.prefs import prefs, PREFS_NAMESPACE -from calibre_plugins.fanfictiondownloader_plugin.dialogs \ +from calibre_plugins.fanficfare_plugin.prefs import prefs, PREFS_NAMESPACE +from calibre_plugins.fanficfare_plugin.dialogs \ import (UPDATE, UPDATEALWAYS, collision_order, save_collisions, RejectListDialog, EditTextDialog, IniTextDialog, RejectUrlEntry) -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.adapters \ +from calibre_plugins.fanficfare_plugin.fff_internals.adapters \ import getConfigSections -from calibre_plugins.fanfictiondownloader_plugin.common_utils \ +from calibre_plugins.fanficfare_plugin.common_utils \ import ( KeyboardConfigDialog, PrefsViewerDialog ) -from calibre_plugins.fanfictiondownloader_plugin.ffdl_util \ +from calibre_plugins.fanficfare_plugin.ffdl_util \ import (test_config) from calibre.gui2.complete2 import EditWithComplete #MultiCompleteLineEdit @@ -358,7 +358,7 @@ class BasicTab(QWidget): self.l = QVBoxLayout() groupbox.setLayout(self.l) - tooltip = _("On each download, FFDL offers an option to select the output format.
This sets what that option will default to.") + tooltip = _("On each download, FFF offers an option to select the output format.
This sets what that option will default to.") horz = QHBoxLayout() label = QLabel(_('Default Output &Format:')) label.setToolTip(tooltip) @@ -375,7 +375,7 @@ class BasicTab(QWidget): horz.addWidget(self.fileform) self.l.addLayout(horz) - tooltip = _("On each download, FFDL offers an option of what happens if that story already exists.
This sets what that option will default to.") + tooltip = _("On each download, FFF offers an option of what happens if that story already exists.
This sets what that option will default to.") horz = QHBoxLayout() label = QLabel(_('Default If Story Already Exists?')) label.setToolTip(tooltip) @@ -392,12 +392,12 @@ class BasicTab(QWidget): self.l.addLayout(horz) self.updatemeta = QCheckBox(_('Default Update Calibre &Metadata?'),self) - self.updatemeta.setToolTip(_("On each download, FFDL offers an option to update Calibre's metadata (title, author, URL, tags, custom columns, etc) from the web site.
This sets whether that will default to on or off.
Columns set to 'New Only' in the column tabs will only be set for new books.")) + self.updatemeta.setToolTip(_("On each download, FFF offers an option to update Calibre's metadata (title, author, URL, tags, custom columns, etc) from the web site.
This sets whether that will default to on or off.
Columns set to 'New Only' in the column tabs will only be set for new books.")) self.updatemeta.setChecked(prefs['updatemeta']) self.l.addWidget(self.updatemeta) self.updateepubcover = QCheckBox(_('Default Update EPUB Cover when Updating EPUB?'),self) - self.updateepubcover.setToolTip(_("On each download, FFDL offers an option to update the book cover image inside the EPUB from the web site when the EPUB is updated.
This sets whether that will default to on or off.")) + self.updateepubcover.setToolTip(_("On each download, FFF offers an option to update the book cover image inside the EPUB from the web site when the EPUB is updated.
This sets whether that will default to on or off.")) self.updateepubcover.setChecked(prefs['updateepubcover']) self.l.addWidget(self.updateepubcover) @@ -501,7 +501,7 @@ class BasicTab(QWidget): self.l.addWidget(self.includeimages) self.injectseries = QCheckBox(_("Inject calibre Series when none found?"),self) - self.injectseries.setToolTip(_("If no series is found, inject the calibre series (if there is one) so it appears on the FFDL title page(not cover).")) + self.injectseries.setToolTip(_("If no series is found, inject the calibre series (if there is one) so it appears on the FFF title page(not cover).")) self.injectseries.setChecked(prefs['injectseries']) self.l.addWidget(self.injectseries) @@ -510,7 +510,7 @@ class BasicTab(QWidget): groupbox.setLayout(self.l) self.rejectlist = QPushButton(_('Edit Reject URL List'), self) - self.rejectlist.setToolTip(_("Edit list of URLs FFDL will automatically Reject.")) + self.rejectlist.setToolTip(_("Edit list of URLs FFF will automatically Reject.")) self.rejectlist.clicked.connect(self.show_rejectlist) self.l.addWidget(self.rejectlist) @@ -610,7 +610,7 @@ class PersonalIniTab(QWidget): self.l.addWidget(label) # self.l.addSpacing(5) - label = QLabel(_("New:")+" "+_("FFDL now includes find, color coding, and error checking for personal.ini editing. Red generally indicates errors.")) + label = QLabel(_("New:")+" "+_("FFF now includes find, color coding, and error checking for personal.ini editing. Red generally indicates errors.")) label.setWordWrap(True) self.l.addWidget(label) @@ -639,7 +639,7 @@ class PersonalIniTab(QWidget): self.defaults.clicked.connect(self.show_defaults) self.l.addWidget(self.defaults) - label = QLabel(_("Changes will only be saved if you click 'OK' to leave Customize FFDL.")) + label = QLabel(_("Changes will only be saved if you click 'OK' to leave Customize FFF.")) label.setWordWrap(True) self.l.addWidget(label) @@ -744,7 +744,7 @@ class GenerateCoverTab(QWidget): except KeyError: gc_settings= [] - label = QLabel(_('The %(gc)s plugin can create cover images for books using various metadata and configurations. If you have GC installed, FFDL can run GC on new downloads and metadata updates. Pick a GC setting by site or Default.')%no_trans) + label = QLabel(_('The %(gc)s plugin can create cover images for books using various metadata and configurations. If you have GC installed, FFF can run GC on new downloads and metadata updates. Pick a GC setting by site or Default.')%no_trans) label.setWordWrap(True) self.l.addWidget(label) self.l.addSpacing(5) @@ -839,12 +839,12 @@ class CountPagesTab(QWidget): horz = QHBoxLayout() self.wordcount = QCheckBox('Word Count',self) - self.wordcount.setToolTip(tooltip+"\n"+_('Will overwrite word count from FFDL metadata if set to update the same custom column.')) + self.wordcount.setToolTip(tooltip+"\n"+_('Will overwrite word count from FFF metadata if set to update the same custom column.')) self.wordcount.setChecked('WordCount' in prefs['countpagesstats']) horz.addWidget(self.wordcount) - self.wordcountmissing = QCheckBox('Only if Word Count is Missing in FFDL Metadata',self) - self.wordcountmissing.setToolTip(_("Only run Count Page's Word Count if checked and FFDL metadata doesn't already have a word count. If this is used with one of the other Page Counts, the Page Count plugin will be called twice.")) + self.wordcountmissing = QCheckBox('Only if Word Count is Missing in FFF Metadata',self) + self.wordcountmissing.setToolTip(_("Only run Count Page's Word Count if checked and FFF metadata doesn't already have a word count. If this is used with one of the other Page Counts, the Page Count plugin will be called twice.")) self.wordcountmissing.setChecked(prefs['wordcountmissing']) self.wordcountmissing.setEnabled(self.wordcount.isChecked()) horz.addWidget(self.wordcountmissing) @@ -984,7 +984,7 @@ titleLabels = { 'formatname':_('File Format'), 'formatext':_('File Extension'), 'siteabbrev':_('Site Abbrev'), - 'version':_('FFDL Version') + 'version':_('FFF Version') } class CustomColumnsTab(QWidget): @@ -1102,7 +1102,7 @@ class StandardColumnsTab(QWidget): self.l = QVBoxLayout() self.setLayout(self.l) - label = QLabel(_("The standard calibre metadata columns are listed below. You may choose whether FFDL will fill each column automatically on updates or only for new books.")) + label = QLabel(_("The standard calibre metadata columns are listed below. You may choose whether FFF will fill each column automatically on updates or only for new books.")) label.setWordWrap(True) self.l.addWidget(label) self.l.addSpacing(5) @@ -1137,7 +1137,7 @@ class ImapTab(QWidget): self.setLayout(self.l) row=0 - label = QLabel(_('These settings will allow FFDL to fetch story URLs from your email account. It will only look for story URLs in unread emails in the folder specified below.')) + label = QLabel(_('These settings will allow FFF to fetch story URLs from your email account. It will only look for story URLs in unread emails in the folder specified below.')) label.setWordWrap(True) self.l.addWidget(label,row,0,1,-1) row+=1 @@ -1163,7 +1163,7 @@ class ImapTab(QWidget): row+=1 label = QLabel(_('IMAP User Password')) - tooltip = _("IMAP password. If left empty, FFDL will ask you for your password when you use the feature.") + tooltip = _("IMAP password. If left empty, FFF will ask you for your password when you use the feature.") label.setToolTip(tooltip) self.l.addWidget(label,row,0) self.imappass = QLineEdit(self) @@ -1174,7 +1174,7 @@ class ImapTab(QWidget): row+=1 self.imapsessionpass = QCheckBox(_('Remember Password for Session (when not saved above)'),self) - self.imapsessionpass.setToolTip(_('If checked, and no password is entered above, FFDL will remember your password until you close calibre or change Libraries.')) + self.imapsessionpass.setToolTip(_('If checked, and no password is entered above, FFF will remember your password until you close calibre or change Libraries.')) self.imapsessionpass.setChecked(prefs['imapsessionpass']) self.l.addWidget(self.imapsessionpass,row,0,1,-1) row+=1 @@ -1196,7 +1196,7 @@ class ImapTab(QWidget): row+=1 label = QLabel(_("It's safest if you create a separate email account that you use only " - "for your story update notices. FFDL and calibre cannot guarantee that " + "for your story update notices. FFF and calibre cannot guarantee that " "malicious code cannot get your email password once you've entered it. " "
Use this feature at your own risk.
")) label.setWordWrap(True) diff --git a/calibre-plugin/dialogs.py b/calibre-plugin/dialogs.py index 639b0b34..43d5ee98 100644 --- a/calibre-plugin/dialogs.py +++ b/calibre-plugin/dialogs.py @@ -60,14 +60,14 @@ try: except NameError: pass # load_translations() added in calibre 1.9 -from calibre_plugins.fanfictiondownloader_plugin.common_utils \ +from calibre_plugins.fanficfare_plugin.common_utils \ import (ReadOnlyTableWidgetItem, ReadOnlyTextIconWidgetItem, SizePersistedDialog, ImageTitleLayout, get_icon) -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.geturls import get_urls_from_html, get_urls_from_text -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.adapters import getNormalStoryURL +from calibre_plugins.fanficfare_plugin.fff_internals.geturls import get_urls_from_html, get_urls_from_text +from calibre_plugins.fanficfare_plugin.fff_internals.adapters import getNormalStoryURL -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.configurable \ +from calibre_plugins.fanficfare_plugin.fff_internals.configurable \ import (get_valid_sections, get_valid_entries, get_valid_keywords, get_valid_entry_keywords) @@ -243,7 +243,7 @@ class AddNewDialog(SizePersistedDialog): self.l = QVBoxLayout() self.setLayout(self.l) - self.setWindowTitle(_('FanFictionDownLoader')) + self.setWindowTitle('FanFicFare') self.setWindowIcon(icon) self.toplabel=QLabel("Toplabel") @@ -588,7 +588,7 @@ class LoopProgressDialog(QProgressDialog): self.start_time = datetime.now() # can't import at file load. - from calibre_plugins.fanfictiondownloader_plugin.prefs import prefs + from calibre_plugins.fanficfare_plugin.prefs import prefs self.show_est_time = prefs['show_est_time'] ## self.do_loop does QTimer.singleShot on self.do_loop also. @@ -686,7 +686,7 @@ class AboutDialog(QDialog): self.label = QLabel(text) self.label.setOpenExternalLinks(True) self.label.setWordWrap(True) - self.setWindowTitle(_('About FanFictionDownLoader')) + self.setWindowTitle(_('About FanFicFare')) self.setWindowIcon(icon) self.l.addWidget(self.logo, 0, 0) self.l.addWidget(self.label, 0, 1) @@ -1026,7 +1026,7 @@ class RejectListDialog(SizePersistedDialog): layout = QVBoxLayout(self) self.setLayout(layout) title_layout = ImageTitleLayout(self, icon, header, - ''+_('FFDL will remember these URLs and display the note and offer to reject them if you try to download them again later.')) + ''+_('FFF will remember these URLs and display the note and offer to reject them if you try to download them again later.')) layout.addLayout(title_layout) rejects_layout = QHBoxLayout() layout.addLayout(rejects_layout) diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index 48c60225..4b46c990 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -48,17 +48,17 @@ try: except NameError: pass # load_translations() added in calibre 1.9 -from calibre_plugins.fanfictiondownloader_plugin.common_utils import (set_plugin_icon_resources, get_icon, - create_menu_action_unique, get_library_uuid) +from calibre_plugins.fanficfare_plugin.common_utils import (set_plugin_icon_resources, get_icon, + create_menu_action_unique, get_library_uuid) -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader import adapters, exceptions -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.epubutils import get_dcsource, get_dcsource_chaptercount, get_story_url_from_html -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.geturls import get_urls_from_page, get_urls_from_html, get_urls_from_text, get_urls_from_imap +from calibre_plugins.fanficfare_plugin.fff_internals import adapters, exceptions +from calibre_plugins.fanficfare_plugin.fff_internals.epubutils import get_dcsource, get_dcsource_chaptercount, get_story_url_from_html +from calibre_plugins.fanficfare_plugin.fff_internals.geturls import get_urls_from_page, get_urls_from_html, get_urls_from_text, get_urls_from_imap -from calibre_plugins.fanfictiondownloader_plugin.ffdl_util import (get_ffdl_adapter, get_ffdl_config, get_ffdl_personalini) -from calibre_plugins.fanfictiondownloader_plugin.config import (permitted_values, rejecturllist) -from calibre_plugins.fanfictiondownloader_plugin.prefs import prefs -from calibre_plugins.fanfictiondownloader_plugin.dialogs import ( +from calibre_plugins.fanficfare_plugin.ffdl_util import (get_ffdl_adapter, get_ffdl_config, get_ffdl_personalini) +from calibre_plugins.fanficfare_plugin.config import (permitted_values, rejecturllist) +from calibre_plugins.fanficfare_plugin.prefs import prefs +from calibre_plugins.fanficfare_plugin.dialogs import ( AddNewDialog, UpdateExistingDialog, LoopProgressDialog, UserPassDialog, AboutDialog, CollectURLDialog, RejectListDialog, EmailPassDialog, OVERWRITE, OVERWRITEALWAYS, UPDATE, UPDATEALWAYS, ADDNEW, SKIP, CALIBREONLY, @@ -76,9 +76,9 @@ formmapping = { PLUGIN_ICONS = ['images/icon.png'] -class FanFictionDownLoaderPlugin(InterfaceAction): +class FanFicFarePlugin(InterfaceAction): - name = 'FanFictionDownLoader' + name = 'FanFicFare' # Declare the main action associated with this plugin # The keyboard shortcut can be None if you dont want to use a keyboard @@ -86,7 +86,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): # keyboard shortcuts, so try to use an unusual/unused shortcut. # (text, icon_path, tooltip, keyboard shortcut) # icon_path isn't in the zip--icon loaded below. - action_spec = (_('FanFictionDownLoader'), None, + action_spec = (_('FanFicFare'), None, _('Download FanFiction stories from various web sites'), ()) # None for keyboard shortcut doesn't allow shortcut. () does, there just isn't one yet @@ -117,7 +117,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): # are not found in the zip file will result in null QIcons. icon = get_icon('images/icon.png') - self.qaction.setText(_('FanFictionDL')) + self.qaction.setText(_('FanFicFare')) # The qaction is automatically created from the action_spec defined # above @@ -237,7 +237,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): def rebuild_menus(self): with self.menus_lock: - #self.qaction.setText("FFDL") + #self.qaction.setText("FFF") do_user_config = self.interface_action_base_plugin.do_user_config self.menu.clear() @@ -332,17 +332,18 @@ class FanFictionDownLoaderPlugin(InterfaceAction): self.menu.addSeparator() self.config_action = self.create_menu_item_ex(self.menu, _('&Configure Plugin'), image= 'config.png', - unique_name='Configure FanFictionDownLoader', - shortcut_name=_('Configure FanFictionDownLoader'), + unique_name='Configure FanFicFare', + shortcut_name=_('Configure FanFicFare'), triggered=partial(do_user_config,parent=self.gui)) self.about_action = self.create_menu_item_ex(self.menu, _('About Plugin'), image= 'images/icon.png', - unique_name='About FanFictionDownLoader', - shortcut_name=_('About FanFictionDownLoader'), + unique_name='About FanFicFare', + shortcut_name=_('About FanFicFare'), triggered=self.about) self.gui.keyboard.finalize() + def about(self): # Get the about text from a file inside the plugin zip file @@ -399,7 +400,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): def get_urls_from_imap_menu(self): if not prefs['imapserver'] or not prefs['imapuser'] or not prefs['imapfolder']: - s=_('FFDL Email Settings are not configured.') + s=_('FFF Email Settings are not configured.') info_dialog(self.gui, s, s, show=True, show_copy_button=False) return @@ -569,7 +570,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): self.gui.iactions['Remove Books'].do_library_delete(d.get_reject_list_ids()) else: - message="

"+_("Rejecting FFDL URLs: None of the books selected have FanFiction URLs.")+"

"+_("Proceed to Remove?")+"

" + message="

"+_("Rejecting FFF URLs: None of the books selected have FanFiction URLs.")+"

"+_("Proceed to Remove?")+"

" if confirm(message,'fanfictiondownloader_reject_non_fanfiction', self.gui): self.gui.iactions['Remove Books'].delete_books() @@ -627,7 +628,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): if not filenames or len(filenames) != len (url_list): info_dialog(self.gui, _("Cannot Update Anthology"), - "

"+_("Cannot Update Anthology")+"

"+_("Book isn't an FFDL Anthology or contains book(s) without valid FFDL URLs."), + "

"+_("Cannot Update Anthology")+"

"+_("Book isn't an FFF Anthology or contains book(s) without valid FFF URLs."), show=True, show_copy_button=False) remove_dir(tdir) @@ -1100,7 +1101,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): elif chaptercount > urlchaptercount: raise NotGoingToDownload(_("Existing epub contains %d chapters, web site only has %d. Use Overwrite to force update.") % (chaptercount,urlchaptercount),'dialog_error.png') elif chaptercount == 0: - raise NotGoingToDownload(_("FFDL doesn't recognize chapters in existing epub, epub is probably from a different source. Use Overwrite to force update."),'dialog_error.png') + raise NotGoingToDownload(_("FFF doesn't recognize chapters in existing epub, epub is probably from a different source. Use Overwrite to force update."),'dialog_error.png') if collision == OVERWRITE and \ db.has_format(book_id,formmapping[fileform],index_is_id=True): @@ -1209,7 +1210,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): payload = ([], book_list, options) self.gui.proceed_question(self.update_error_column, payload, htmllog, - _('FFDL log'), _('FFDL download ended'), msg, + _('FFF log'), _('FFF download ended'), msg, show_copy_button=False) return @@ -1227,7 +1228,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): func = 'arbitrary_n' cpus = self.gui.job_manager.server.pool_size - args = ['calibre_plugins.fanfictiondownloader_plugin.jobs', 'do_download_worker', + args = ['calibre_plugins.fanficfare_plugin.jobs', 'do_download_worker', (book_list, options, cpus)] desc = _('Download FanFiction Book') job = self.gui.job_manager.run_job( @@ -1270,7 +1271,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): logger.error("Error Updating Metadata:\n%s"%det_msg) error_dialog(self.gui, _("Error Updating Metadata"), - "

"+_("An error has occurred while FFDL was updating calibre's metadata for %s.")%(book['url'],book['title'])+"

"+ + "

"+_("An error has occurred while FFF was updating calibre's metadata for %s.")%(book['url'],book['title'])+"

"+ _("The ebook has been updated, but the metadata has not."), det_msg=det_msg, show=True) @@ -1380,7 +1381,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): show_copy_button=False) return - msg = '

'+_('FFDL found %s good and %s bad updates.')%(len(good_list),len(bad_list))+'

' + msg = '

'+_('FFF found %s good and %s bad updates.')%(len(good_list),len(bad_list))+'

' if len(bad_list) > 0: msg = msg + '''

%s

@@ -1419,7 +1420,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction):

%s

%s

%s

'''%( - _('FFDL found %s good and %s bad updates.')%(len(good_list),len(bad_list)), + _('FFF found %s good and %s bad updates.')%(len(good_list),len(bad_list)), _('See log for details.'), _('Proceed with updating your library?') ) @@ -1445,7 +1446,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): self.gui.proceed_question(do_update_func, payload, htmllog, - _('FFDL log'), _('FFDL download complete'), msg, + _('FFF log'), _('FFF download complete'), msg, show_copy_button=False) def do_download_merge_update(self, payload): @@ -1498,7 +1499,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): good_list = sorted(good_list,key=lambda x : x['listorder']) bad_list = sorted(bad_list,key=lambda x : x['listorder']) - self.gui.status_bar.show_message(_('FFDL Adding/Updating books.')) + self.gui.status_bar.show_message(_('FFF Adding/Updating books.')) if good_list or prefs['mark'] or (bad_list and prefs['errorcol'] != '' and prefs['errorcol'] in self.gui.library_view.model().custom_columns): LoopProgressDialog(self.gui, @@ -1839,7 +1840,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): rl_plugin = self.gui.iactions['Reading List'] except: if prefs['addtolists'] or prefs['addtoreadlists']: - message="

"+_("You configured FanFictionDownLoader to automatically update Reading Lists, but you don't have the %s plugin installed anymore?")%'Reading List'+"

" + message="

"+_("You configured FanFicFare to automatically update Reading Lists, but you don't have the %s plugin installed anymore?")%'Reading List'+"

" confirm(message,'fanfictiondownloader_no_reading_list_plugin', self.gui) return @@ -1851,7 +1852,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): lists = self.get_clean_reading_lists(prefs['read_lists']) if len(lists) < 1 : - message="

"+_("You configured FanFictionDownLoader to automatically update \"To Read\" Reading Lists, but you don't have any lists set?")+"

" + message="

"+_("You configured FanFicFare to automatically update \"To Read\" Reading Lists, but you don't have any lists set?")+"

" confirm(message,'fanfictiondownloader_no_read_lists', self.gui) for l in lists: if l in rl_plugin.get_list_names(): @@ -1861,13 +1862,13 @@ class FanFictionDownLoaderPlugin(InterfaceAction): display_warnings=False) else: if l != '': - message="

"+_("You configured FanFictionDownLoader to automatically update Reading List '%s', but you don't have a list of that name?")%l+"

" + message="

"+_("You configured FanFicFare to automatically update Reading List '%s', but you don't have a list of that name?")%l+"

" confirm(message,'fanfictiondownloader_no_reading_list_%s'%l, self.gui) if prefs['addtolists'] and (add or (prefs['addtolistsonread'] and prefs['addtoreadlists']) ): lists = self.get_clean_reading_lists(prefs['send_lists']) if len(lists) < 1 : - message="

"+_("You configured FanFictionDownLoader to automatically update \"Send to Device\" Reading Lists, but you don't have any lists set?")+"

" + message="

"+_("You configured FanFicFare to automatically update \"Send to Device\" Reading Lists, but you don't have any lists set?")+"

" confirm(message,'fanfictiondownloader_no_send_lists', self.gui) for l in lists: @@ -1879,7 +1880,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): display_warnings=False) else: if l != '': - message="

"+_("You configured FanFictionDownLoader to automatically update Reading List '%s', but you don't have a list of that name?")%l+"

" + message="

"+_("You configured FanFicFare to automatically update Reading List '%s', but you don't have a list of that name?")%l+"

" confirm(message,'fanfictiondownloader_no_reading_list_%s'%l, self.gui) def make_mi_from_book(self,book): diff --git a/calibre-plugin/ffdl_util.py b/calibre-plugin/ffdl_util.py index b36055cb..2fbbac8b 100644 --- a/calibre-plugin/ffdl_util.py +++ b/calibre-plugin/ffdl_util.py @@ -13,9 +13,9 @@ from ConfigParser import ParsingError import logging logger = logging.getLogger(__name__) -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader import adapters, exceptions -from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.configurable import Configuration -from calibre_plugins.fanfictiondownloader_plugin.prefs import prefs +from calibre_plugins.fanficfare_plugin.fff_internals import adapters, exceptions +from calibre_plugins.fanficfare_plugin.fff_internals.configurable import Configuration +from calibre_plugins.fanficfare_plugin.prefs import prefs def get_ffdl_personalini(): if prefs['includeimages']: diff --git a/calibre-plugin/images/icon.png b/calibre-plugin/images/icon.png index e9715307..f71d750a 100644 Binary files a/calibre-plugin/images/icon.png and b/calibre-plugin/images/icon.png differ diff --git a/calibre-plugin/images/icon2.xcf b/calibre-plugin/images/icon2.xcf new file mode 100644 index 00000000..d8fa5cb4 Binary files /dev/null and b/calibre-plugin/images/icon2.xcf differ diff --git a/calibre-plugin/images/old icon.png b/calibre-plugin/images/old icon.png new file mode 100644 index 00000000..e9715307 Binary files /dev/null and b/calibre-plugin/images/old icon.png differ diff --git a/calibre-plugin/jobs.py b/calibre-plugin/jobs.py index 917539a5..e2ef3436 100644 --- a/calibre-plugin/jobs.py +++ b/calibre-plugin/jobs.py @@ -42,7 +42,7 @@ def do_download_worker(book_list, options, logger.info("%s"%book['url']) if book['good']: total += 1 - args = ['calibre_plugins.fanfictiondownloader_plugin.jobs', + args = ['calibre_plugins.fanficfare_plugin.jobs', 'do_download_for_worker', (book,options)] job = ParallelJob('arbitrary_n', @@ -95,16 +95,16 @@ def do_download_for_worker(book,options,notification=lambda x,y:x): Child job, to download story when run as a worker job ''' - from calibre_plugins.fanfictiondownloader_plugin import FanFictionDownLoaderBase - ffdlbase = FanFictionDownLoaderBase(options['plugin_path']) + from calibre_plugins.fanficfare_plugin import FanFicFareBase + ffdlbase = FanFicFareBase(options['plugin_path']) with ffdlbase: - from calibre_plugins.fanfictiondownloader_plugin.dialogs import (NotGoingToDownload, + from calibre_plugins.fanficfare_plugin.dialogs import (NotGoingToDownload, OVERWRITE, OVERWRITEALWAYS, UPDATE, UPDATEALWAYS, ADDNEW, SKIP, CALIBREONLY) - from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader import adapters, writers, exceptions - from calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.epubutils import get_update_data + from calibre_plugins.fanficfare_plugin.fff_internals import adapters, writers, exceptions + from calibre_plugins.fanficfare_plugin.fff_internals.epubutils import get_update_data - from calibre_plugins.fanfictiondownloader_plugin.ffdl_util import (get_ffdl_adapter, get_ffdl_config) + from calibre_plugins.fanficfare_plugin.ffdl_util import (get_ffdl_adapter, get_ffdl_config) try: book['comment'] = _('Download started...') diff --git a/plugin-defaults.ini b/calibre-plugin/plugin-defaults.ini similarity index 97% rename from plugin-defaults.ini rename to calibre-plugin/plugin-defaults.ini index 4cb63eae..f6bd44f6 100644 --- a/plugin-defaults.ini +++ b/calibre-plugin/plugin-defaults.ini @@ -1,2003 +1,2003 @@ -# Copyright 2013 Fanficdownloader team -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -[defaults] - -## [defaults] section applies to all formats and sites but may be -## overridden at several levels. Example: - -## [defaults] -## titlepage_entries: category,genre, status -## [www.whofic.com] -## # overrides defaults. -## titlepage_entries: category,genre, status,dateUpdated,rating -## [epub] -## # overrides defaults & site section -## titlepage_entries: category,genre, status,datePublished,dateUpdated,dateCreated -## [www.whofic.com:epub] -## # overrides defaults, site section & format section -## titlepage_entries: category,genre, status,datePublished -## [overrides] -## # overrides all other sections -## titlepage_entries: category - -## Some sites also require the user to confirm they are adult for -## adult content. Uncomment by removing '#' in front of is_adult. -#is_adult:true - -## All available titlepage_entries and the label used for them: -## _label: