Ejemplo n.º 1
0
 def find_roms(self):
     """
     Reads a list of all the ROMs from the appropriate directory for the
     console
     """
     roms = []
     for filename in os.listdir(self.roms_directory()):
         file_path = os.path.join(self.roms_directory(),filename)
         if not os.path.isdir(file_path):
             # On Linux/OSX, we want to make sure hidden files don't get
             # accidently added as well
             if not pf.is_windows() and filename.startswith('.'):
                 continue
             if self.emulator is not None and not self.is_valid_rom(file_path):
                 ice_logger.log_warning("Ignoring Non-ROM file: %s" % file_path)
                 continue
             roms.append(ROM(file_path,self))
     return roms
Ejemplo n.º 2
0
 def find_roms(self):
     """
     Reads a list of all the ROMs from the appropriate directory for the
     console
     """
     roms = []
     if not os.path.exists(self.roms_directory()):
         ice_logger.log("Creating %s directory at %s" % (self.shortname,self.roms_directory()))
         os.makedirs(self.roms_directory())
     for filename in os.listdir(self.roms_directory()):
         file_path = os.path.join(self.roms_directory(),filename)
         if not os.path.isdir(file_path):
             # On Linux/OSX, we want to make sure hidden files don't get
             # accidently added as well
             if not pf.is_windows() and filename.startswith('.'):
                 continue
             if self.emulator is not None and not self.is_valid_rom(file_path):
                 ice_logger.log_warning("Ignoring Non-ROM file: %s" % file_path)
                 continue
             roms.append(ROM(file_path,self))
     return roms
Ejemplo n.º 3
0
 def find_all_roms(self):
     """
     Reads a list of all the ROMs from the appropriate directory for the
     console
     """
     roms = []
     # If the emulator is not functional, we pretend it doesn't have any
     # ROMs
     if not self.emulator.is_functional():
         return roms
     for filename in os.listdir(self.roms_directory()):
         file_path = os.path.join(self.roms_directory(),filename)
         if not os.path.isdir(file_path):
             # On Linux/OSX, we want to make sure hidden files don't get
             # accidently added as well
             if not pf.is_windows() and filename.startswith('.'):
                 continue
             if self.emulator is not None and not self.valid_rom(file_path):
                 log_file("Ignoring Non-ROM file: %s" % file_path)
                 continue
             roms.append(ROM(file_path,self))
     return roms