-
-
Save mjkoo/0eb70888b6085b3f65f5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2 | |
# NOTE: Use of this script is deprecated, instead I recommend you use | |
# | |
# $ unzip -LL eui_v1_20.zip -d "$HOME/.steam/steam/SteamApps/common/Sid Meier's Civilization V/steamassets/assets/dlc" | |
# | |
# to make use of the unzip command's built-in conversion to lowercase filenames | |
# (thanks reddit user /u/xkero and github user Mfdas) | |
import os | |
import shutil | |
import sys | |
import tempfile | |
import zipfile | |
# Verify this is the right path on your system | |
DLC_DIR = '~/.steam/steam/SteamApps/common/Sid Meier\'s Civilization V/steamassets/assets/dlc' | |
EUI_DIR = 'UI_bc1' | |
if __name__ == '__main__': | |
# Quick and dirty argument parsing | |
if len(sys.argv) != 2: | |
print 'Usage: %s [ZIPFILE]' % sys.argv[0] | |
sys.exit(-1) | |
eui_zipfile = sys.argv[1] | |
try: | |
tempdir = tempfile.mkdtemp() | |
with zipfile.ZipFile(sys.argv[1], 'r') as zf: | |
zf.extractall(tempdir) | |
srcdir = os.path.join(tempdir, EUI_DIR) | |
dstdir = os.path.join(os.path.expanduser(DLC_DIR), EUI_DIR.lower()) | |
shutil.copytree(srcdir, dstdir) | |
os.chdir(dstdir) | |
for root, dirnames, filenames in os.walk('.', topdown=False): | |
for filename in dirnames + filenames: | |
orig = os.path.join(root, filename) | |
new = orig.lower() | |
try: | |
os.renames(orig, new) | |
except: | |
pass | |
finally: | |
if tempdir: | |
shutil.rmtree(tempdir) |
You may want to change shebang to use specifically Python 2, since in some distributions (namely Arch Linux), default Python is 3.
On Arch Linux:
DLC_DIR = '~/.local/share/Steam/SteamApps/common/Sid Meier's Civilization V/steamassets/assets/dlc'
On Ubuntu 15.04
DLC_DIR = '~/.steam/steam/steamapps/common/Sid Meier's Civilization V/steamassets/assets/dlc'
How to use:
- First, make sure the script is set to be executable and that the path to the DLC directory is correct (other comments will help)
- Put the EUI zip with the py script in the same folder for ease.
- Open a terminal at the location of the two files.
- Drag the py file into the terminal; it will put the path to the file in the terminal.
- Type the full name of the EUI zip (including '.zip') after the space following the path to the py file.
- Hit Enter.
- Confirm your Steam Civ 5 DLC folder has a folder called ui_bc1
- Done!
Example terminal code:
If you put the files on your desktop, the text in the terminal should look something like
/home/username/Desktop/eui_install.py eui_v1_27c.zip
I'm not sure if this is the right place for this, but a much easier way to do this would just unzip the original EUI zip using 'unzip -LL eui_zip.zip' which automatically forces conversion of every directory and filename to lowercase.
Thanks for the comment Mfdas, noted in comments. Definitely a better way to do it, this was discussed in the reddit thread as well.
This also seems to work (after extracting):
convmv --lower -r -f UTF-8 --notest UI_bc1
How can i use this script?, i recently bought the game and execute the script with parameter the euizip but does not work, this need some permission or some extra package or work?