Exemplo n.º 1
0
def processFiles(file1, file2):
    fileName1 = util.getFileName(file1)
    fileName2 = util.getFileName(file2)
    if (util.is_wave_file(fileName1) and util.is_wave_file(fileName2) and
    util.get_length(fileName1) == util.get_length(fileName2)):
        match_found = util.compare(fileName2, fileName2)
        if match_found:
            print("MATCH %s %s", file1, file2)
        else:
            print("NO MATCH FOUND")
    else:
        print("NO MATCH FOUND")
Exemplo n.º 2
0
def resourceJson(path):
    #NOTE Path should be resources/resName/resName.yy
    #e.g. extensions/Asset/Asset.yy

    json = {'id': {'name': getFileName(path, True), 'path': path}, 'order': 0}

    return json
Exemplo n.º 3
0
    def copyTargetConfigurationFiles(self, buildData):
        '''
        This function checks if paths to target configuration files listed in 'BuildDataStrings.targetConfigurationPaths'
        are available, stored inside this workspace '.vscode' subfolder. Once this files are copied, paths are updated and
        new buildData is returned.

        Paths are previously checked/updated in 'verifyTargetConfigurationPaths()'
        '''
        for pathName in self.bStr.targetConfigurationPaths:
            currentPaths = buildData[pathName]

            if isinstance(currentPaths, list):
                isList = True
            else:
                isList = False
                currentPaths = [currentPaths]

            newPaths = []
            for currentPath in currentPaths:
                fileName = utils.getFileName(currentPath, withExtension=True)
                fileInVsCodeFolder = os.path.join(utils.vsCodeFolderPath,
                                                  fileName)

                if not utils.pathExists(fileInVsCodeFolder):
                    # file does not exist in '.vscode' folder
                    try:
                        newPath = shutil.copy(currentPath,
                                              utils.vsCodeFolderPath)
                    except Exception as err:
                        errorMsg = "Unable to copy file '" + fileName + "' to '.vscode' folder. Exception:\n" + str(
                            err)
                        utils.printAndQuit(errorMsg)

                newPath = os.path.relpath(fileInVsCodeFolder)
                newPath = utils.pathWithForwardSlashes(newPath)
                newPaths.append(newPath)

            if isList:
                buildData[pathName] = newPaths
            else:
                buildData[pathName] = newPaths[0]

        return buildData
Exemplo n.º 4
0
#!/usr/bin/python

import utilities
from zombiesmash import *

class ZombieRun:

    def run(self):
        print "in run"

if __name__ == "__main__":

    fName = utilities.getFileName()
    data = utilities.getDataFromFile(fName)

    for gameData in data:
        game = zombiesmash(gameData)
        game.run()
Exemplo n.º 5
0
def makeProjectFromDir(dir, assetName):
	yypFile = utils.getDirExtensionFiles(dir, 'yyp')[0]
	name = utils.getFileName(yypFile, True)
	project = Project(name, dir, assetName)

	return project
Exemplo n.º 6
0
	def __init__(self, path, type):
		name= utils.getFileName(path, True)
		dir = dirname(path)
		self.type = type

		File.__init__(self, name, dir, 'yy')
def includeFolderToProject(folderPath, projectFolders):
	folderName = utils.getFileName(folderPath, True)
	folder = folderJson(folderPath, folderName)
	projectFolders.append(folder)
Exemplo n.º 8
0
 def __init__(self, path=None):
     # Fields
     self._abnormalities = []
     self._path = path
     self._file = File(name=getFileName(self._path))
     self._f = open(path, 'rb')