Ticket #4467: mythburn_patch_fix_ValueError.patch
File mythburn_patch_fix_ValueError.patch, 1.7 KB (added by , 16 years ago) |
---|
-
.py
old new 14 14 # paulh 15 15 # 4 May 2006 - Added into mythtv svn 16 16 17 # banyan 18 # 14 Jan 2008 - Fixed issue in CopyRemote causing the following exception: 19 # ValueError: too many values to unpack 20 # Cause: a mount with spaces in the path split into more than 6 parts. 21 # This caused the assignment of the parts to fail later. 22 # Solution: replaced the split() and assignment with a regular expression. 23 17 24 #For this script to work you need to have... 18 25 #Python2.3.5 19 26 #python2.3-mysqldb … … 31 38 #****************************************************************************** 32 39 33 40 # version of script - change after each update 34 VERSION="0.1.200 71115-1.fixes"41 VERSION="0.1.20080114-1.fixes" 35 42 36 43 37 44 ##You can use this debug flag when testing out new themes … … 55 62 import Image, ImageDraw, ImageFont 56 63 import MySQLdb, codecs 57 64 import time, datetime, tempfile 65 import re 58 66 from fcntl import ioctl 59 67 from CDROM import CDROMEJECT 60 68 from CDROM import CDROMCLOSETRAY … … 3294 3302 mounts = os.popen('mount') 3295 3303 # Go through each line of mounts output 3296 3304 for line in mounts.readlines(): 3297 parts = line.split()3298 3305 # mount says in this format 3299 device, txt1, mountpoint, txt2, filesystem, options = parts 3306 m = re.match(r"(.*)( on )(.*)( type )(.*)\s(\(.*\))", line) 3307 assert m, "Could not parse the mount line:\n\t%s" % line 3308 device, txt1, mountpoint, txt2, filesystem, options = m.group(1),"on",m.group(3),"type",m.group(5),m.group(6) 3300 3309 # only do if really remote 3301 3310 if filesystem in remotefs: 3302 3311 # add remote to list