Ticket #2734: backendip.patch
File backendip.patch, 2.3 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
50 50 import fetch_poster 51 51 import distutils.file_util 52 52 53 from MythTV import MythDB, MythVideo 54 55 mythdb = MythDB() 56 mythvideo = MythVideo() 57 53 58 try: 54 59 # If found, we can insert data directly to MythDB 55 60 from MythTV import MythDB, MythVideo … … 109 114 return 110 115 111 116 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 117 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 118 def find_imdb_id_from_text_file(textFile): 141 119 142 120 if os.access(textFile, os.R_OK): … … 555 533 if candidates is None or len(candidates) == 0: 556 534 # TODO: Try with the dirname 557 535 pass 558 559 536 if candidates is not None and len(candidates) > 0: 560 537 561 538 index = 0 … … 909 886 print "You must have the MythTV module to make direct DB importing to work" 910 887 sys.exit(1) 911 888 poster_dir = mythdb.getSetting("VideoArtworkDir", socket.gethostname()) 889 if not mythdb: 890 print "Could not get VideoArtworkDir setting for the current host." 891 sys.exit(1) 912 892 913 914 893 if prune: 915 894 mythvideo.pruneMetadata() 916 895