Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 669205 Details for
Bug 869440
Bring Anki 2 to Fedora
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patched used in the updated .spec
0001-Fix-aqt-share.py-indentation.patch (text/plain), 6.00 KB, created by
Christophe Fergeau
on 2012-12-26 12:30:22 UTC
(
hide
)
Description:
Patched used in the updated .spec
Filename:
MIME Type:
Creator:
Christophe Fergeau
Created:
2012-12-26 12:30:22 UTC
Size:
6.00 KB
patch
obsolete
>From bad1df3c5cd992722a5b40016c0673470a4aaef9 Mon Sep 17 00:00:00 2001 >From: Christophe Fergeau <cfergeau@redhat.com> >Date: Wed, 26 Dec 2012 11:45:33 +0100 >Subject: [PATCH] Fix aqt/share.py indentation > >--- > aqt/share.py | 156 +++++++++++++++++++++++++++++------------------------------ > 1 file changed, 78 insertions(+), 78 deletions(-) > >diff --git a/aqt/share.py b/aqt/share.py >index c5997e3..79772fc 100644 >--- a/aqt/share.py >+++ b/aqt/share.py >@@ -1,71 +1,71 @@ > # to be moved into libanki > >- def _copyToTmpDeck(self, name="cram.anki", tags="", ids=[]): >- # fixme: use namedtmp >- ndir = tempfile.mkdtemp(prefix="anki") >- path = os.path.join(ndir, name) >- from anki.exporting import AnkiExporter >- e = AnkiExporter(self.deck) >- e.includeMedia = False >- if tags: >- e.limitTags = parseTags(tags) >- if ids: >- e.limitCardIds = ids >- path = unicode(path, sys.getfilesystemencoding()) >- e.exportInto(path) >- return (e, path) >+def _copyToTmpDeck(self, name="cram.anki", tags="", ids=[]): >+ # fixme: use namedtmp >+ ndir = tempfile.mkdtemp(prefix="anki") >+ path = os.path.join(ndir, name) >+ from anki.exporting import AnkiExporter >+ e = AnkiExporter(self.deck) >+ e.includeMedia = False >+ if tags: >+ e.limitTags = parseTags(tags) >+ if ids: >+ e.limitCardIds = ids >+ path = unicode(path, sys.getfilesystemencoding()) >+ e.exportInto(path) >+ return (e, path) > >- def onShare(self, tags): >- pwd = os.getcwd() >- # open tmp deck >- (e, path) = self._copyToTmpDeck(name="shared.anki", tags=tags) >- if not e.exportedCards: >- showInfo(_("No cards matched the provided tags.")) >- return >- self.deck.startProgress() >- self.deck.updateProgress() >- d = DeckStorage.Deck(path, backup=False) >- # reset scheduling to defaults >- d.newCardsPerDay = 20 >- d.delay0 = 600 >- d.delay1 = 0 >- d.delay2 = 0 >- d.hardIntervalMin = 1.0 >- d.hardIntervalMax = 1.1 >- d.midIntervalMin = 3.0 >- d.midIntervalMax = 5.0 >- d.easyIntervalMin = 7.0 >- d.easyIntervalMax = 9.0 >- d.syncName = None >- d.setVar("newActive", u"") >- d.setVar("newInactive", u"") >- d.setVar("revActive", u"") >- d.setVar("revInactive", u"") >- self.deck.updateProgress() >- # unsuspend cards >- d.unsuspendCards(d.s.column0("select id from cards where type < 0")) >- self.deck.updateProgress() >- d.utcOffset = -2 >- d.flushMod() >- d.save() >- self.deck.updateProgress() >- # media >- d.s.statement("update deckVars set value = '' where key = 'mediaURL'") >- self.deck.updateProgress() >- d.s.statement("vacuum") >- self.deck.updateProgress() >- nnotes = d.noteCount >- mdir = self.deck.mediaDir() >- d.close() >- dir = os.path.dirname(path) >- zippath = os.path.join(dir, "shared-%d.zip" % time.time()) >- # zip it up >- zip = zipfile.ZipFile(zippath, "w", zipfile.ZIP_DEFLATED) >- zip.writestr("notes", str(nnotes)) >- zip.writestr("version", str(2)) >- readmep = os.path.join(dir, "README.html") >- readme = open(readmep, "w") >- readme.write('''\ >+def onShare(self, tags): >+ pwd = os.getcwd() >+ # open tmp deck >+ (e, path) = self._copyToTmpDeck(name="shared.anki", tags=tags) >+ if not e.exportedCards: >+ showInfo(_("No cards matched the provided tags.")) >+ return >+ self.deck.startProgress() >+ self.deck.updateProgress() >+ d = DeckStorage.Deck(path, backup=False) >+ # reset scheduling to defaults >+ d.newCardsPerDay = 20 >+ d.delay0 = 600 >+ d.delay1 = 0 >+ d.delay2 = 0 >+ d.hardIntervalMin = 1.0 >+ d.hardIntervalMax = 1.1 >+ d.midIntervalMin = 3.0 >+ d.midIntervalMax = 5.0 >+ d.easyIntervalMin = 7.0 >+ d.easyIntervalMax = 9.0 >+ d.syncName = None >+ d.setVar("newActive", u"") >+ d.setVar("newInactive", u"") >+ d.setVar("revActive", u"") >+ d.setVar("revInactive", u"") >+ self.deck.updateProgress() >+ # unsuspend cards >+ d.unsuspendCards(d.s.column0("select id from cards where type < 0")) >+ self.deck.updateProgress() >+ d.utcOffset = -2 >+ d.flushMod() >+ d.save() >+ self.deck.updateProgress() >+ # media >+ d.s.statement("update deckVars set value = '' where key = 'mediaURL'") >+ self.deck.updateProgress() >+ d.s.statement("vacuum") >+ self.deck.updateProgress() >+ nnotes = d.noteCount >+ mdir = self.deck.mediaDir() >+ d.close() >+ dir = os.path.dirname(path) >+ zippath = os.path.join(dir, "shared-%d.zip" % time.time()) >+ # zip it up >+ zip = zipfile.ZipFile(zippath, "w", zipfile.ZIP_DEFLATED) >+ zip.writestr("notes", str(nnotes)) >+ zip.writestr("version", str(2)) >+ readmep = os.path.join(dir, "README.html") >+ readme = open(readmep, "w") >+ readme.write('''\ > <html><body> > This is an exported packaged deck created by Anki.<p> > >@@ -74,17 +74,17 @@ To share this deck with other people, upload it to > http://ankiweb.net/file/upload</a>, or email > it to your friends. > </body></html>''') >- readme.close() >- zip.write(readmep, "README.html") >- zip.write(path, "shared.anki") >- if mdir: >- for f in os.listdir(mdir): >- zip.write(os.path.join(mdir, f), >- os.path.join("shared.media/", f)) >- os.chdir(pwd) >+ readme.close() >+ zip.write(readmep, "README.html") >+ zip.write(path, "shared.anki") >+ if mdir: >+ for f in os.listdir(mdir): >+ zip.write(os.path.join(mdir, f), >+ os.path.join("shared.media/", f)) > os.chdir(pwd) >- self.deck.updateProgress() >- zip.close() >- os.unlink(path) >- self.deck.finishProgress() >- self.onOpenPluginFolder(dir) >+ os.chdir(pwd) >+ self.deck.updateProgress() >+ zip.close() >+ os.unlink(path) >+ self.deck.finishProgress() >+ self.onOpenPluginFolder(dir) >-- >1.8.0.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 869440
:
669204
|
669205
|
669689
|
671808
|
676589