Example #1
0
    def init(self, path, name):
        info = Project.findProject(path)
        if info:
            raise ProjectException('Gii project already initialized:' +
                                   info['path'])
        #
        path = os.path.realpath(path)
        if not os.path.isdir(path):
            raise ProjectException('%s is not a valid path' % path)
        self._initPath(path)
        #
        logging.info('copy template contents')
        from MainModulePath import getMainModulePath

        def ignore(src, names):
            return ['.DS_Store']

        shutil.copytree(getMainModulePath('template/host'),
                        self.getPath('host'), ignore)
        shutil.copytree(getMainModulePath('template/game'),
                        self.getPath('game'), ignore)
        shutil.copy(getMainModulePath('template/.gitignore'), self.getPath())
        #
        self._affirmDirectories()

        try:
            self.cacheManager.init(_GII_ENV_CONFIG_DIR, self.envConfigPath)
        except OSError, e:
            raise ProjectException('error creating cache folder:%s' % e)
Example #2
0
def scanTools(path):
    global _libTools, _prjTools
    mainPath = getMainModulePath()
    _libTools = scanToolsInPath(mainPath + '/' + _DEFAULT_TOOL_PATH)
    if path:
        _prjTools = scanToolsInPath(path + '/' + _DEFAULT_TOOL_PATH)
    return (_libTools, _prjTools)
Example #3
0
def scanTools( path ):
	global _libTools, _prjTools
	mainPath  = getMainModulePath()
	_libTools = scanToolsInPath( mainPath + '/' + _DEFAULT_TOOL_PATH )
	if path:
		_prjTools = scanToolsInPath( path + '/' + _DEFAULT_TOOL_PATH )
	return ( _libTools, _prjTools )
Example #4
0
	def init( self, path, name ):
		info = Project.findProject( path )
		if info:
			raise ProjectException( 'Gii project already initialized:' + info['path'] )
		#
		path = os.path.realpath(path)
		if not os.path.isdir(path):
			raise ProjectException('%s is not a valid path' % path)
		self._initPath( path )
		#
		logging.info( 'copy template contents' )
		from MainModulePath import getMainModulePath
		def ignore( src, names ):
			return ['.DS_Store']
		shutil.copytree( getMainModulePath('template/host'), self.getPath('host'), ignore )
		shutil.copytree( getMainModulePath('template/game'), self.getPath('game'), ignore )
		shutil.copy( getMainModulePath('template/.gitignore'), self.getPath() )
		#
		self._affirmDirectories()

		try:
			self.cacheManager.init( _GII_ENV_CONFIG_DIR, self.envConfigPath )
		except OSError,e:
			raise ProjectException('error creating cache folder:%s' % e)
Example #5
0
    def __init__(self):
        assert (not EditorApp._singleton)
        EditorApp._singleton = self
        EditorModuleManager.get()._app = self

        self.defaultMainloopBudget = 0.005

        self.initialized = False
        self.projectLoaded = False
        self.flagModified = False
        self.debugging = False
        self.running = False
        self.basePath = getMainModulePath()
        self.dataPaths = []
        self.config = {}
        self.packageManager = PackageManager()

        self.commandRegistry = EditorCommandRegistry.get()
        self.remoteCommandRegistry = RemoteCommandRegistry.get()

        self.registerDataPath(self.getPath('data'))

        signals.connect('module.register', self.onModuleRegister)
Example #6
0
	def __init__(self):
		assert(not EditorApp._singleton)
		EditorApp._singleton = self
		EditorModuleManager.get()._app = self

		self.defaultMainloopBudget = 0.005

		self.initialized   = False
		self.projectLoaded = False
		self.flagModified  = False
		self.debugging     = False
		self.running       = False
		self.basePath      = getMainModulePath()
		self.dataPaths     = []
		self.config        = {}
		self.packageManager   = PackageManager()

		self.commandRegistry       = EditorCommandRegistry.get()
		self.remoteCommandRegistry = RemoteCommandRegistry.get()
		
		self.registerDataPath( self.getPath('data') )

		signals.connect( 'module.register', self.onModuleRegister )