def steam_userdata_location():
    platform = settings.platform_string()
    if platform == "Windows":
        # On Windows, the userdata directory is the steam installation directory
        # with 'userdata' appeneded
        return os.path.join(windows_steam_location(), "userdata")
    elif platform == "OSX":
        # I'm pretty sure the user can't change this on OS X. I think it always
        # goes to the same location
        return os.path.expanduser(osx_userdata_directory)
def steam_userdata_location():
    platform = settings.platform_string()
    if platform == "Windows":
        # On Windows, the userdata directory is the steam installation directory
        # with 'userdata' appeneded
        return os.path.join(windows_steam_location(),"userdata")
    elif platform == "OSX":
        # I'm pretty sure the user can't change this on OS X. I think it always
        # goes to the same location
        return os.path.expanduser(osx_userdata_directory)
Example #3
0
 def executable_string(self):
     """
     The command string which should go in the executable. This command
     should, when executed, launch the correct emulator and open the ROM.
     """
     platform = settings.platform_string()
     if platform == "Windows":
         return "\"%s\" \"%s\"" % (self.console.emulator_path, self.path)
     elif platform == "OSX":
         # Check if we are running an application or a shell script
         if self.console.emulator.location.endswith(".app"):
             # If we are running an app, we need to do 'open -a {app_path}'
             return "#!/usr/bin/env bash\nopen -a \"%s\" \"%s\"\n" % (self.console.emulator.location, self.path)
         else:
             # If we are running a script, we just execute the script
             return "#!/usr/bin/env bash\n\"%s\" \"%s\"\n" % (self.console.emulator.location,self.path)
             
     else:
         # TODO: Figure out how to make this string on Linux
         return ""
Example #4
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 settings.platform_string() != "Windows" and filename.startswith('.'):
                 continue
             if self.emulator is not None and not self.emulator.valid_rom(file_path):
                 log_file("Ignoring Non-ROM file: %s" % file_path)
                 continue
             roms.append(ROM(file_path,self))
     return roms
Example #5
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 settings.platform_string(
             ) != "Windows" and filename.startswith('.'):
                 continue
             if self.emulator is not None and not self.emulator.valid_rom(
                     file_path):
                 log_file("Ignoring Non-ROM file: %s" % file_path)
                 continue
             roms.append(ROM(file_path, self))
     return roms
Example #6
0
 def __find_emulator__(self):
     """
     Uses the settings to determine the emulator path for a given console
     """
     platform = settings.platform_string()
     return emulator_manager.lookup_emulator(platform,self)
Example #7
0
 def __find_emulator__(self):
     """
     Uses the settings to determine the emulator path for a given console
     """
     platform = settings.platform_string()
     return emulator_manager.lookup_emulator(platform, self)