def onNameDone(inputString):
	global createConfig
	global context
	global shadowList
	moduleFile = context.getBaseDir() + createConfig["packageBase"] + "/" + inputString
	createConfig["moduleFile"] = moduleFile
	print moduleFile

	name = moduleFile[moduleFile.rfind("/"):]
	if not "." in name:
		if createConfig["type"] == "script":
			ext = ".js"
			name += ext
		elif createConfig["type"] == "text":
			ext = ".html"
			name += ext
	else:
		ext = name[name.rfind("."):]

	moduleDir = moduleFile[0:moduleFile.rfind("/")]
	moduleFile = moduleDir + name
	createConfig["moduleFile"] = moduleFile
	if os.path.exists(moduleDir) == False:
		os.makedirs(moduleDir)

	# ask for snippet
	if len(context.settings["module_templates"]) > 0:
		snippetsDir = context.getBaseDir() + context.settings["module_templates"]
		snippets = []
		shadowList =[]
		snippets.append("Blank")
		shadowList.append("")
		for file in os.listdir(snippetsDir):
			dirfile = os.path.join(snippetsDir, file)
			if os.path.isfile(dirfile):
				print "TEST .=" + str(ntpath.basename(file)[0:1]), str(ntpath.basename(file)[0:1]) is "."
				if "DS_Store" not in ntpath.basename(file):
					snippets.append(ntpath.basename(file))
					shadowList.append(dirfile)

		context.window.show_quick_panel(snippets, onSnippetSelected, 0)
	else:
		finish("")
dataset/ETHPy150Open jkcom/SublimeRJS/core/factory.py/onNameDone/original