# Path: simpleMediaCenter/browser/Browser.py
# class FileBrowser(Browser):    
#     __logger=logging.getLogger(__name__)
# 
#     def __init__(self,startDirectory='~'):
#         self.__logger.debug('init')
#         tempDir = os.path.expanduser(startDirectory)
#         tempDir = os.path.abspath(tempDir)
#         self.dirlist = {
#                 0 : tempDir
#             }
#         self.setWorkingDir(0)
#     
#     def getPlayable(self, fileKey):
#         temp = os.path.join(self.workingDir,self.filelist[fileKey])
#         self.__logger.debug('getPlayable:' + temp)
#         return temp
#         
#     def getPath(self, pathKey):
#         tempPath = os.path.join(self.workingDir,self.dirlist[pathKey])
#         tempPath = os.path.abspath(tempPath)
#         self.__logger.debug('getPath:' + tempPath)
#         return tempPath
#       
#     def getSupportedPlayers(self):
#         return ['Omxplayer', 'MPlayer']
#       
#     def setWorkingDir(self, newWorkingDirID):
#         self.workingDir = self.getPath(newWorkingDirID)
#         list = os.listdir(self.workingDir)
#         
#         dirlistcounter=0
#         filelistcounter=0
#         self.dirlist = {}
#         self.filelist = {}
#         
#         self.dirlist[dirlistcounter] = '.'
#         dirlistcounter+=1
#         
#         self.dirlist[dirlistcounter] = '..'
#         dirlistcounter+=1
#         
#         for entry in list:
#             testentry = os.path.join(self.workingDir,entry)
#             if(os.path.isfile(testentry)):
#                 self.filelist[filelistcounter] = entry
#                 filelistcounter+=1
#             else:
#                 self.dirlist[dirlistcounter] = entry
#                 dirlistcounter+=1


from simpleMediaCenter.browser.Browser import FileBrowser
import unittest
import time
import os

class TestFileBrowser(unittest.TestCase):
    fileBrowser = None
    

    def setUp(self):

# Path: simpleMediaCenter/browser/Browser.py
# class FileBrowser(Browser):    
#     __logger=logging.getLogger(__name__)
# 
#     def __init__(self,startDirectory='~'):
#         self.__logger.debug('init')
#         tempDir = os.path.expanduser(startDirectory)
#         tempDir = os.path.abspath(tempDir)
#         self.dirlist = {
#                 0 : tempDir
#             }
#         self.setWorkingDir(0)
#     
#     def getPlayable(self, fileKey):
#         temp = os.path.join(self.workingDir,self.filelist[fileKey])
#         self.__logger.debug('getPlayable:' + temp)
#         return temp
#         
#     def getPath(self, pathKey):
#         tempPath = os.path.join(self.workingDir,self.dirlist[pathKey])
#         tempPath = os.path.abspath(tempPath)
#         self.__logger.debug('getPath:' + tempPath)
#         return tempPath
#       
#     def getSupportedPlayers(self):
#         return ['Omxplayer', 'MPlayer']
#       
#     def setWorkingDir(self, newWorkingDirID):
#         self.workingDir = self.getPath(newWorkingDirID)
#         list = os.listdir(self.workingDir)
#         
#         dirlistcounter=0
#         filelistcounter=0
#         self.dirlist = {}
#         self.filelist = {}
#         
#         self.dirlist[dirlistcounter] = '.'
#         dirlistcounter+=1
#         
#         self.dirlist[dirlistcounter] = '..'
#         dirlistcounter+=1
#         
#         for entry in list:
#             testentry = os.path.join(self.workingDir,entry)
#             if(os.path.isfile(testentry)):
#                 self.filelist[filelistcounter] = entry
#                 filelistcounter+=1
#             else:
#                 self.dirlist[dirlistcounter] = entry
#                 dirlistcounter+=1


# Path: test/test_FileBrowser.py
from simpleMediaCenter.browser.Browser import FileBrowser
import unittest
import time
import os


class TestFileBrowser(unittest.TestCase):
    fileBrowser = None
    

    def setUp(self):

        self.fileBrowser = FileBrowser(".")