Ejemplo n.º 1
0
 def deleteEntry(self, entry, parent):
     if entry.publications:
         text = _('This entry has been published to weblogs.\n'
                  'Do you want to delete this entry with all publications?')
     else:
         text = _('Do you really want to delete this entry?')
     if apputils.question(text, parent.window):
         i = len(entry.publications) - 1
         if DEBUG:
             print entry.publications
         while i > -1:
             publication = entry.publications[i]
             blog = publication.weblog
             publication.deleteRemoteEntry(blog, parent)
             publication.destroySelf()
             i = i - 1
         entry.destroySelf()
         louie.send('entry-deleted')
Ejemplo n.º 2
0
 def deleteEntry(self, entry, parent):
     if entry.publications:
         text = _('This entry has been published to weblogs.\n'
             'Do you want to delete this entry with all publications?')
     else:
         text = _('Do you really want to delete this entry?')
     if apputils.question(text, parent.window):
         i = len(entry.publications) - 1
         if DEBUG:
             print entry.publications
         while i > -1:
             publication = entry.publications[i]
             blog = publication.weblog
             publication.deleteRemoteEntry(blog, parent)
             publication.destroySelf()
             i = i - 1
         entry.destroySelf()
         louie.send('entry-deleted')
Ejemplo n.º 3
0
 def _addCategories(self, categories):
     msg = _('Downloaded %d categories, do you want to update list?') \
         % len(categories)
     if apputils.question(msg):
         for remoteCat in categories:
             remoteCat['updated'] = False
             for (name, desc, category) in self.model:
                 if name.decode('utf-8') == remoteCat['name']:
                     category.description = remoteCat['description']
                     remoteCat['updated'] = True
         for remoteCat in categories:
             if not remoteCat['updated']:
                 name = remoteCat['name']
                 description = remoteCat['description']
                 category = datamodel.Category(name=name,
                     description=description)
                 self.model.append((name,\
                     apputils.ellipsize(description, 80), category))
     return False
Ejemplo n.º 4
0
 def _addCategories(self, categories):
     msg = _('Downloaded %d categories, do you want to update list?') \
         % len(categories)
     if apputils.question(msg):
         for remoteCat in categories:
             remoteCat['updated'] = False
             for (name, desc, category) in self.model:
                 if name.decode('utf-8') == remoteCat['name']:
                     category.description = remoteCat['description']
                     remoteCat['updated'] = True
         for remoteCat in categories:
             if not remoteCat['updated']:
                 name = remoteCat['name']
                 description = remoteCat['description']
                 category = datamodel.Category(name=name,
                                               description=description)
                 self.model.append((name,\
                     apputils.ellipsize(description, 80), category))
     return False
Ejemplo n.º 5
0
 def deleteWeblog(self, weblog, parent):
     text = _('Do you really want to delete this weblog?')
     if apputils.question(text, parent.window):
         weblog.destroySelf()
         louie.send('weblog-deleted')
Ejemplo n.º 6
0
 def deleteIdentity(self, identity, parent):
     text = _('Do you really want to delete this identity?')
     if apputils.question(text, parent.window):
         identity.destroySelf()
         louie.send('identity-deleted')
Ejemplo n.º 7
0
 def deleteCategory(self, category, parent):
     text = _('Do you really want to delete this category?')
     if apputils.question(text, parent.window):
         category.destroySelf()
         louie.send('category-deleted')
Ejemplo n.º 8
0
 def deleteWeblog(self, weblog, parent):
     text = _('Do you really want to delete this weblog?')
     if apputils.question(text, parent.window):
         weblog.destroySelf()
         louie.send('weblog-deleted')
Ejemplo n.º 9
0
 def deleteIdentity(self, identity, parent):
     text = _('Do you really want to delete this identity?')
     if apputils.question(text, parent.window):
         identity.destroySelf()
         louie.send('identity-deleted')
Ejemplo n.º 10
0
 def deleteCategory(self, category, parent):
     text = _('Do you really want to delete this category?')
     if apputils.question(text, parent.window):
         category.destroySelf()
         louie.send('category-deleted')