Skip to content

Commit

Permalink
move versionWithBuild into anki module
Browse files Browse the repository at this point in the history
  • Loading branch information
dae committed Feb 27, 2019
1 parent 47eab46 commit a389b8b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
aqt/forms
locale
tools/runanki.system
aqt/buildhash.py
anki/buildhash.py
2 changes: 1 addition & 1 deletion anki/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from anki.db import DB, DBError
from anki.utils import ids2str, intTime, json, platDesc, checksum, devMode
from anki.consts import *
from aqt.utils import versionWithBuild
from anki.utils import versionWithBuild
from .hooks import runHook
import anki
from .lang import ngettext
Expand Down
10 changes: 10 additions & 0 deletions anki/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,3 +407,13 @@ def log(self, s):
sys.stderr.write("%5dms: %s(): %s\n" % ((time.time() - self._last)*1000, fn, s))
self._last = time.time()

# Version
##############################################################################

def versionWithBuild():
from anki import version
try:
from anki.buildhash import build
except:
build = "dev"
return "%s (%s)" % (version, build)
3 changes: 2 additions & 1 deletion aqt/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

from aqt.qt import *
import aqt.forms
from aqt.utils import versionWithBuild, supportText, tooltip
from anki.utils import versionWithBuild
from aqt.utils import supportText, tooltip

class ClosableQDialog(QDialog):
def reject(self):
Expand Down
6 changes: 2 additions & 4 deletions aqt/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@

from aqt.qt import *
import aqt
from aqt.utils import openLink
from anki.utils import json, platDesc
from aqt.utils import showText
from aqt.utils import versionWithBuild
from aqt.utils import openLink, showText
from anki.utils import platDesc, versionWithBuild

class LatestVersionFinder(QThread):

Expand Down
14 changes: 3 additions & 11 deletions aqt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html

from aqt.qt import *
import re, os, sys, urllib.request, urllib.parse, urllib.error, subprocess
import re, os, sys, subprocess
import aqt
from anki.sound import stripSounds
from anki.utils import isWin, isMac, invalidFilename, noBundledLibs
from anki.utils import isWin, isMac, invalidFilename, noBundledLibs, \
versionWithBuild

def openHelp(section):
link = aqt.appHelpSite
Expand Down Expand Up @@ -565,18 +566,9 @@ def qtMenuShortcutWorkaround(qmenu):

######################################################################

def versionWithBuild():
from aqt import appVersion
try:
from aqt.buildhash import build
except:
build = "dev"
return "%s (%s)" % (appVersion, build)

def supportText():
import platform
from aqt import mw
from aqt.utils import versionWithBuild

if isWin:
platname = "Windows " + platform.win32_ver()[0]
Expand Down

0 comments on commit a389b8b

Please sign in to comment.