Ticket #2734: backendip2.patch
File backendip2.patch, 2.0 KB (added by , 17 years ago) |
---|
-
mythvideo/scripts/MythTV.py
69 69 for config_file in config_files: 70 70 try: 71 71 config = shlex.shlex(open(config_file)) 72 config.wordchars += "." 72 73 except: 73 74 continue 74 75 -
mythvideo/scripts/find_meta.py
109 109 return 110 110 111 111 db = None 112 def init_db():113 global db114 try:115 config = shlex.shlex(open(os.path.expanduser('~/.mythtv/mysql.txt')))116 except:117 print "Error opening ~/.mythtv/mysql.txt"118 return False119 112 120 121 token = config.get_token()122 db_host = db_user = db_password = None123 while token != config.eof and (db_host == None or db_user == None or db_password == None):124 if token == "DBHostName":125 if config.get_token() == "=":126 db_host = config.get_token()127 elif token == "DBUserName":128 if config.get_token() == "=":129 db_user = config.get_token()130 elif token == "DBPassword":131 if config.get_token() == "=":132 db_password = config.get_token()133 134 token = config.get_token()135 db = MySQLdb.connect(user=db_user, host=db_host, passwd=db_password,136 db="mythconverg")137 print_verbose("Database connection successful.")138 return True139 140 113 def find_imdb_id_from_text_file(textFile): 141 114 142 115 if os.access(textFile, os.R_OK): … … 555 528 if candidates is None or len(candidates) == 0: 556 529 # TODO: Try with the dirname 557 530 pass 558 559 531 if candidates is not None and len(candidates) > 0: 560 532 561 533 index = 0 … … 909 881 print "You must have the MythTV module to make direct DB importing to work" 910 882 sys.exit(1) 911 883 poster_dir = mythdb.getSetting("VideoArtworkDir", socket.gethostname()) 884 if not mythdb: 885 print "Could not get VideoArtworkDir setting for the current host." 886 sys.exit(1) 912 887 913 914 888 if prune: 915 889 mythvideo.pruneMetadata() 916 890