예제 #1
0
파일: mg9.py 프로젝트: allanw1/Arianrhod
def ext_main_file(install=False):
	src_dir = ext_pkg_path()

	def ext_fn():
		l = sorted(glob.glob('%s/*.go' % src_dir))
		return l[0] if l else ''

	fn = ext_fn()
	if fn or not install:
		return fn

	try:
		gs.mkdirp(src_dir)
		with open('%s/gosublime.go' % src_dir, 'x') as f:
			f.write(DEFAULT_EXT_SRC)
	except FileExistsError:
		pass
	except Exception:
		gs.error_traceback(DOMAIN, status_txt='Cannot create default extension package')

	return ext_fn()
예제 #2
0
def ext_main_file(install=False):
    src_dir = ext_pkg_path()

    def ext_fn():
        l = sorted(glob.glob('%s/*.go' % src_dir))
        return l[0] if l else ''

    fn = ext_fn()
    if fn or not install:
        return fn

    try:
        gs.mkdirp(src_dir)
        with open('%s/gosublime.go' % src_dir, 'x') as f:
            f.write(DEFAULT_EXT_SRC)
    except FileExistsError:
        pass
    except Exception:
        gs.error_traceback(
            DOMAIN, status_txt='Cannot create default extension package')

    return ext_fn()