~ubuntu-branches/ubuntu/karmic/calibre/karmic

« back to all changes in this revision

Viewing changes to src/calibre/gui2/dialogs/scheduler.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730124941-qjdsmri25zt8zocn
Tags: 0.6.3+dfsg-0ubuntu1
* New upstream release. Please see http://calibre.kovidgoyal.net/new_in_6/
  for the list of new features and changes.
* remove_postinstall.patch: Update for new version.
* build_debug.patch: Does not apply any more, disable for now. Might not be
  necessary any more.
* debian/copyright: Fix reference to versionless GPL.
* debian/rules: Drop obsolete dh_desktop call.
* debian/rules: Add workaround for weird Python 2.6 setuptools behaviour of
  putting compiled .so files into src/calibre/plugins/calibre/plugins
  instead of src/calibre/plugins.
* debian/rules: Drop hal fdi moving, new upstream version does not use hal
  any more. Drop hal dependency, too.
* debian/rules: Install udev rules into /lib/udev/rules.d.
* Add debian/calibre.preinst: Remove unmodified
  /etc/udev/rules.d/95-calibre.rules on upgrade.
* debian/control: Bump Python dependencies to 2.6, since upstream needs
  it now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from calibre.utils.pyparsing import ParseException
21
21
from calibre.gui2 import NONE, error_dialog, config as gconf
22
22
from calibre.utils.config import DynamicConfig
 
23
from calibre.ptempfile import PersistentTemporaryFile
23
24
from calibre.gui2.dialogs.user_profiles import UserProfiles
24
25
 
25
26
config = DynamicConfig('scheduler')
132
133
        self._map = dict(self.category_map)
133
134
 
134
135
    def scheduled_recipes(self):
135
 
        for recipe in self.category_map[_('Scheduled')]:
 
136
        for recipe in self.category_map.get(_('Scheduled'), []):
136
137
            yield recipe
137
138
 
138
139
    def sort_categories(self, x, y):
181
182
        self.reset()
182
183
 
183
184
    def index(self, row, column, parent):
184
 
        return self.createIndex(row, column, parent.row() if parent.isValid() else -1)
 
185
        return self.createIndex(row, column, parent.row()+1 if parent.isValid() else 0)
185
186
 
186
187
    def parent(self, index):
187
 
        if index.internalId() == -1:
 
188
        if index.internalId() == 0:
188
189
            return QModelIndex()
189
 
        return self.createIndex(index.internalId(), 0, -1)
 
190
        return self.createIndex(index.internalId()-1, 0, 0)
190
191
 
191
192
    def columnCount(self, parent):
192
193
        if not parent.isValid() or not parent.parent().isValid():
522
523
                self.recipes.remove(recipe)
523
524
                save_recipes(self.recipes)
524
525
                return
 
526
            pt = PersistentTemporaryFile('_builtin.recipe')
 
527
            pt.write(script)
 
528
            pt.close()
 
529
            script = pt.name
525
530
        except ValueError:
526
 
            script = recipe.title
 
531
            script = recipe.title + '.recipe'
527
532
        self.debug('\tQueueing:', recipe)
528
533
        self.main.download_scheduled_recipe(recipe, script, self.recipe_downloaded)
529
534
        self.queue.add(recipe)