(self, path=None, url=None)
return executable_files
Parse an application list and return a dictionary.

        Accepted formats:
            MyGame.exe
            MyGame.exe: Game Name
            MyGame.exe[Window Name]
            MyGame.exe[Window Name]: Game Name
Parse an application list and return a dictionary.
Parse an application list and return a dictionary .
def _read(self, path=None, url=None):
        """Parse an application list and return a dictionary.

        Accepted formats:
            MyGame.exe
            MyGame.exe: Game Name
            MyGame.exe[Window Name]
            MyGame.exe[Window Name]: Game Name
        """
        if path is None:
            if url is None:
                return {}
                
            #Read file from URL
            try:
                lines = get_url_contents(url).decode('utf-8').split('\n')
            except AttributeError:
                return {}
                
        else:
            #Read from script directory
            try:
                with TextFile(path.replace('\\', '/').split('/')[-1], 'r', encoding='utf-8') as f:
                    lines = [i.strip() for i in f.readlines()]
            except IOError:
                lines = []
                
            #Read from documents
            try:
                with TextFile(path, 'r', encoding='utf-8') as f:
                    lines += [i.strip() for i in f.readlines()]
            except IOError:
                if not lines:
                    return {}

        executable_files = {}
        for line in lines:
                        
            #Ignore comments
            if line.startswith('//'):
                continue

            #Check for each extensions
            #TODO: Allow no extension, such as hl2_osx in OSX
            no_space = line.replace(' ', '').lower()
            for ext in self.extensions:
                if ext in no_space:

                    #In the format "MyGame.exe: Game Name"
                    if self.extensions[ext][':'] in no_space:
                        executable_name, game_name = line.split(':', 1)
                        window_name = None

                    #In the format "MyGame.exe[Window Name]"
                    #or "MyGame.exe[Window Name]: Game Name"
                    elif self.extensions[ext]['['] in no_space:
                        executable_name, remaining = line.split('[', 1)
                        window_name, remaining = remaining.split(']', 1)
                        if remaining.strip().startswith(':'):
                            game_name = remaining.split(':', 1)[1]
                        else:
                            game_name = window_name.replace(TRACKING_WILDCARD, '').strip()

                    #In the format "MyGame.exe"
                    elif no_space.endswith(ext):
                        executable_name = line
                        window_name = None
                        game_name = line[:-self.extensions[ext]['len']]
                    else:
                        continue
                    
                    try:
                        executable_files[executable_name.strip()][window_name] = game_name.strip()
                    except KeyError:
                        executable_files[executable_name.strip()] = {window_name: game_name.strip()}
                    
        return executable_files
def _read ( self , path = None , url = None ) : if path is None : if url is None : return { } #Read file from URL try : lines = get_url_contents ( url ) . decode ( 'utf-8' ) . split ( '\n' ) except AttributeError : return { } else : #Read from script directory try : with TextFile ( path . replace ( '\\' , '/' ) . split ( '/' ) [ - 1 ] , 'r' , encoding = 'utf-8' ) as f : lines = [ i . strip ( ) for i in f . readlines ( ) ] except IOError : lines = [ ] #Read from documents try : with TextFile ( path , 'r' , encoding = 'utf-8' ) as f : lines += [ i . strip ( ) for i in f . readlines ( ) ] except IOError : if not lines : return { } executable_files = { } for line in lines : #Ignore comments if line . startswith ( '//' ) : continue #Check for each extensions #TODO: Allow no extension, such as hl2_osx in OSX no_space = line . replace ( ' ' , '' ) . lower ( ) for ext in self . extensions : if ext in no_space : #In the format "MyGame.exe: Game Name" if self . extensions [ ext ] [ ':' ] in no_space : executable_name , game_name = line . split ( ':' , 1 ) window_name = None #In the format "MyGame.exe[Window Name]" #or "MyGame.exe[Window Name]: Game Name" elif self . extensions [ ext ] [ '[' ] in no_space : executable_name , remaining = line . split ( '[' , 1 ) window_name , remaining = remaining . split ( ']' , 1 ) if remaining . strip ( ) . startswith ( ':' ) : game_name = remaining . split ( ':' , 1 ) [ 1 ] else : game_name = window_name . replace ( TRACKING_WILDCARD , '' ) . strip ( ) #In the format "MyGame.exe" elif no_space . endswith ( ext ) : executable_name = line window_name = None game_name = line [ : - self . extensions [ ext ] [ 'len' ] ] else : continue try : executable_files [ executable_name . strip ( ) ] [ window_name ] = game_name . strip ( ) except KeyError : executable_files [ executable_name . strip ( ) ] = { window_name : game_name . strip ( ) } return executable_files