diff --git a/.gitignore b/.gitignore index 4f4c9b8..b584207 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ *.py[cod] -.idea + +# .idea files + +*.iws +workspace.xml +tasks.xml # C extensions *.so diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 0d75b01..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,509 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1357264391946 - 1357264391946 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hardware/fileSystem.py b/hardware/fileSystem.py index 132e2ac..480b250 100644 --- a/hardware/fileSystem.py +++ b/hardware/fileSystem.py @@ -1,37 +1,23 @@ __author__ = 'leandro' -from tools import tools class HardDisk: def __init__(self): pass -class GeneralFileSystem: +class GeneralFileSystemObject: def __init__(self,name): self.name = name -class Directory(GeneralFileSystem): +class Directory(GeneralFileSystemObject): def __init__(self,name): super(Directory,self).__init__(name) self.filesAndDirectories = {} - def addFile(self,path,file): - tools.checkValidPathFormatToDir(path) - if path == "/": - self.filesAndDirectories[file.name] = file - else: - directories = path.split("/") - directoryName = directories[0] - newPath = "/".join(directories[1:]) - directory = self.getDir(directoryName) - directory.addFile(newPath,file) - - def getDir(self,dirName): - try: - return self.filesAndDirectories[dirName] - except KeyError: - raise CantFindDirectory() + def addFile(self,file,path=""): + pass + #Exceptions diff --git a/tools/__init__.py b/tools/__init__.py deleted file mode 100644 index 0c72454..0000000 --- a/tools/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'leandro' diff --git a/tools/tools.py b/tools/tools.py deleted file mode 100644 index 91f750d..0000000 --- a/tools/tools.py +++ /dev/null @@ -1,13 +0,0 @@ -__author__ = 'leandro' - -def checkValidPathFormatToDir(aPath): - if not aPath: - raise InvalidPath() - if not aPath.endsWith("/"): - raise InvalidPath() - -#exceptions - -class InvalidPath(Exception): - def __init__(self): - super(InvalidPath,self).__init__()