Ticket #2734: backendip2.patch

File backendip2.patch, 2.0 KB (added by Pekka Jääskeläinen <pekka.jaaskelainen@…>, 17 years ago)
  • mythvideo/scripts/MythTV.py

     
    6969                for config_file in config_files:
    7070                        try:
    7171                                config = shlex.shlex(open(config_file))
     72                                config.wordchars += "."
    7273                        except:
    7374                                continue
    7475       
  • mythvideo/scripts/find_meta.py

     
    109109        return
    110110
    111111db = None
    112 def init_db():
    113         global db
    114         try:
    115                 config = shlex.shlex(open(os.path.expanduser('~/.mythtv/mysql.txt')))
    116         except:
    117                 print "Error opening ~/.mythtv/mysql.txt"
    118                 return False
    119112
    120 
    121         token = config.get_token()
    122         db_host = db_user = db_password = None
    123         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 True
    139 
    140113def find_imdb_id_from_text_file(textFile):
    141114
    142115        if os.access(textFile, os.R_OK):
     
    555528                if candidates is None or len(candidates) == 0:
    556529                        # TODO: Try with the dirname
    557530                        pass
    558 
    559531                if candidates is not None and len(candidates) > 0:
    560532
    561533                        index = 0
     
    909881                        print "You must have the MythTV module to make direct DB importing to work"
    910882                        sys.exit(1)
    911883                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)
    912887
    913 
    914888        if prune:
    915889                mythvideo.pruneMetadata()
    916890