Browse Source

fix utils scripts

remotes/origin/next
Romain Goffe 11 years ago
parent
commit
ab43d82ec2
  1. 5
      utils/resize-cover.py
  2. 8
      utils/rules.py

5
utils/resize-cover.py

@ -4,12 +4,13 @@
#Author: Romain Goffe #Author: Romain Goffe
#Date: 28/12/2011 #Date: 28/12/2011
#Description: Resize all covers to 128,128 thumbnails #Description: Resize all covers to 128,128 thumbnails
import os
import Image import Image
from utils.utils import recursiveFind from utils import recursiveFind
# Process song files # Process song files
library = "./"
covers = recursiveFind(os.path.join(library, 'songs'), '*.jpg') covers = recursiveFind(os.path.join(library, 'songs'), '*.jpg')
for filename in covers: for filename in covers:

8
utils/rules.py

@ -3,12 +3,12 @@
import glob import glob
import getopt, sys import getopt, sys
import re import re, os
import logging import logging
import locale import locale
re.LOCALE re.LOCALE
from utils.utils import recursiveFind from utils import recursiveFind
# the dictionary has target_word:replacement_word pairs # the dictionary has target_word:replacement_word pairs
word_dic = { word_dic = {
@ -238,7 +238,7 @@ def main():
usage() usage()
sys.exit(2) sys.exit(2)
songfiles = recursiveFind(os.path.join(library, 'songs'), '*.sg') library = './'
loglevel = "warning" loglevel = "warning"
for option, arg in opts: for option, arg in opts:
@ -256,6 +256,8 @@ def main():
else: else:
assert False, "unhandled option" assert False, "unhandled option"
songfiles = recursiveFind(os.path.join(library, 'songs'), '*.sg')
for filename in songfiles: for filename in songfiles:
with open(filename, 'r+') as songfile: with open(filename, 'r+') as songfile:
logging.info("checking file: "+filename) logging.info("checking file: "+filename)

Loading…
Cancel
Save