Skip to content

Commit 4a76f03

Browse files
Daniel NunesInfernio
authored andcommitted
Squashed version of ganda-build-v2
commit 584c214 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Tue Oct 22 20:11:40 2019 +0100 Move loot API installation to pip commit 7126217 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Sat Nov 9 20:46:00 2019 +0000 Remove icon from Mopy folder It's not used anywhere, only the one in the standalone folder is used. From discussions with Arthmoor, its purpose was to be provided for the source distributable. Source dist packaging has been changed to reflect this. commit a7a0f03 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Fri Nov 8 16:03:26 2019 +0000 Rework repo cleaning for building Removed all those file shenanigans in favour of simple git stashing for ensuring a clean repo when building the distributables. We should get a slight performance boost since we're no longer iterating over the entire repository 50 times per build - the stashing is slow, yes, but it makes up for it by making everything else lightning fast. File lists are dumb and no longer used for 7z packaging - 7z has a very good wildcard/exclusion system and we should be using that. Printing the python version and those git warnings was kept, it's not super useful but pretty adorable. Removed the ability to change logfiles and output folder - no one was using the anyway and makes the stashing much more straightforward. The loot api is no longer imported directly but only as-needed - importing it at the start blocks stashing since the files are being used. A simple check if the files exist is enough to check whether they're installed. commit a730994 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Thu Nov 7 22:30:58 2019 +0000 Clean up building executable Moved all py2exe-specific code to setup.py Simplified the functions in build.py commit 6e58a63 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Fri Nov 8 18:43:00 2019 +0000 Simplify file version parsing Removed the ability to build with a custom version - only nightly and production builds should exist. See https://github.com/wrye-bash/wrye-bash/wiki/%5Bdev%5D-What-to-call-released-builds Restricts file version parsing to either nightly or production, as above. This allows a dramatic reduction in complexity. commit da36805 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Fri Nov 1 20:35:15 2019 +0000 Remove reshacker icon setting Resource Hacker is useless, py2exe can set an icon all by itself. Gets rid of a big step in building, helps with keeping a slim and tidy log. Also removes another useless executable from the repo. commit 67c992e Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Fri Oct 25 21:11:55 2019 +0100 Remove UPX compression commit 2d2a971 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Thu Oct 24 22:52:45 2019 +0100 Improve build log readability Added log level to file handler and fixed captured output newlines, both dramatically improve log readability. commit af83830 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Fri Oct 11 21:38:02 2019 +0200 Abort if timestamp matches last build Avoids accidentally uploading builds with the same version number if one builds them too quickly. commit 4b1e290 Author: Daniel Nunes <daniel.henri.nunes@gmail.com> Date: Wed May 1 14:23:12 2019 +0100 Update default LOOT API version in build to 4.0.2 Update masterlist version
1 parent a7daeea commit 4a76f03

15 files changed

Lines changed: 391 additions & 828 deletions

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,3 @@ Mopy/bash/l10n/*NEW.txt
4040
# if a symlink
4141
.idea
4242
.vscode
43-
44-
# The LOOT API binaries
45-
Mopy/loot_api.*
46-
Mopy/loot_api_python.pdb
47-
Mopy/README.md

Mopy/Docs/Wrye Bash Advanced Readme.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ <h3 id="install-loot-api">LOOT API <a class="back2top" href="#contents">Back to
216216
<li>Check if a more recent v1.x release is available on <a href="https://github.com/loot/loot-api-python/releases">GitHub</a>. Releases with a different major version number (releases are major.minor.patch) than the version Wrye Bash bundles are incompatible and cannot be upgraded to.
217217
<li>Download and extract the release's <code>*.7z</code> file.
218218
<li>Make sure Wrye Bash is not running.
219-
<li>Copy the <code>loot_api.dll</code> and <code>loot_api.pyd</code> files you extracted into your Wrye Bash's <code>Mopy</code> folder, replacing the existing files.
219+
<li>Copy the <code>loot.dll</code> and <code>loot_api.pyd</code> files you extracted into your Wrye Bash's <code>Mopy</code> folder, replacing the existing files.
220220
<li>Start Wrye Bash.
221221
</ol>
222222
<p>Standalone users cannot upgrade their bundled LOOT API because its <code>loot_api.pyd</code> file is compiled into the standalone executable.

Mopy/bash.ico

-116 KB
Binary file not shown.

Mopy/bash/bosh/mods_metadata.py

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import os
2626
import re
2727

28+
import loot_api
29+
2830
from ._mergeability import is_esl_capable
2931
from .. import balt, bolt, bush, bass, load_order
3032
from ..bolt import GPath, deprint, sio, struct_pack, struct_unpack
@@ -33,11 +35,6 @@
3335
from ..exception import BoltError, CancelError, ModError
3436
from ..patcher import getPatchesPath, getPatchesList
3537

36-
try:
37-
import loot_api
38-
except ImportError as e:
39-
loot_api = None
40-
deprint(u'Failed to import the loot_api module: ({})'.format(e))
4138

4239
lootDb = None #--LootDb singleton
4340

@@ -227,23 +224,20 @@ class ConfigHelpers(object):
227224
def __init__(self):
228225
"""bass.dir must have been initialized"""
229226
global lootDb
230-
if loot_api is not None:
231-
deprint(u'Using LOOT API version:', loot_api.Version.string())
232-
try:
233-
gameType = self.getLootApiGameType(bush.game.fsName)
234-
loot_api.initialise_locale('')
235-
loot_game = loot_api.create_game_handle(gameType, bass.dirs['app'].s)
236-
lootDb = loot_game.get_database()
237-
except (OSError, AttributeError):
238-
deprint(u'The LOOT API failed to initialize', traceback=True)
239-
lootDb = None
240-
except ValueError:
241-
deprint(u'The LOOT API does not support the current game.')
242-
lootDb = None
243-
except RuntimeError:
244-
deprint(u'Failed to create a LOOT API database.')
245-
lootDb = None
246-
else:
227+
deprint(u'Using LOOT API version:', loot_api.Version.string())
228+
try:
229+
gameType = self.getLootApiGameType(bush.game.fsName)
230+
loot_api.initialise_locale('')
231+
loot_game = loot_api.create_game_handle(gameType, bass.dirs['app'].s)
232+
lootDb = loot_game.get_database()
233+
except (OSError, AttributeError):
234+
deprint(u'The LOOT API failed to initialize', traceback=True)
235+
lootDb = None
236+
except ValueError:
237+
deprint(u'The LOOT API does not support the current game.')
238+
lootDb = None
239+
except RuntimeError:
240+
deprint(u'Failed to create a LOOT API database.')
247241
lootDb = None
248242
# LOOT stores the masterlist/userlist in a %LOCALAPPDATA% subdirectory.
249243
self.lootMasterPath = bass.dirs['userApp'].join(
@@ -317,8 +311,6 @@ def getTagsInfoCache(self, modName):
317311

318312
@staticmethod
319313
def getLootApiGameType(fsName):
320-
if loot_api is None:
321-
return None
322314
if fsName == 'Oblivion':
323315
return loot_api.GameType.tes4
324316
# TODO See if LOOT adds a new GameType for Enderal

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ chardet~=3.0
33
pywin32>=220,<225
44
https://github.com/wrye-bash/dev-tools/raw/master/wheels/wxPython-3.0.2.0-cp27-cp27m-win32.whl
55
# Runtime, recommended
6+
https://bintray.com/loot/snapshots/download_file?file_path=loot_api_python-4.0.2-7-g580bf87_master-python2.7-win32.zip
67
scandir~=1.9
78
# Compile/Build-time
89
pygit2~=0.28

0 commit comments

Comments
 (0)