Returns this site-package esri toolbox directory.
549660
def sys_toolbox_dir():
    
    return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'esri', 'toolboxes')
1026923
def _get_template_dirs():
    """"""
    return filter(lambda x: os.path.exists(x), [
        # user dir
        os.path.join(os.path.expanduser('~'), '.py2pack', 'templates'),
        # system wide dir
        os.path.join('/', 'usr', 'share', 'py2pack', 'templates'),
        # usually inside the site-packages dir
        os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates'),
    ])
774810
def get_arcpy():  
  '''
  
  '''
  install_dir = locate_arcgis()  
  arcpy = path.join(install_dir, "arcpy")
  # Check we have the arcpy directory.
  if not path.exists(arcpy):
    raise ImportError("Could not find arcpy directory in {0}".format(install_dir))

  # First check if we have a bin64 directory - this exists when arcgis is 64bit
  bin_dir = path.join(install_dir, "bin64")
  
  # check if we are using a 64-bit version of Python
  is_64bits = sys.maxsize > 2**32
  
  if not path.exists(bin_dir) or is_64bits == False:
    # Fall back to regular 'bin' dir otherwise.
    bin_dir = path.join(install_dir, "bin")

  scripts = path.join(install_dir, "ArcToolbox", "Scripts")  
  sys.path.extend([arcpy, bin_dir, scripts])
362940
private String getWlpOutputDir() throws IOException {
        Properties envvars = new Properties();
        
        File serverEnvFile = new File(installDirectory, "etc/server.env");
        if (serverEnvFile.exists()) {
            envvars.load(new FileInputStream(serverEnvFile));
        }
        
        serverEnvFile = new File(configDirectory, "server.env");
        if (configDirectory != null && serverEnvFile.exists()) {
            envvars.load(new FileInputStream(serverEnvFile));
        } else if (serverEnv.exists()) {
            envvars.load(new FileInputStream(serverEnv));
        }
        
        return (String) envvars.get("WLP_OUTPUT_DIR");
    }
970054
def getReposPackageFolder():
	""""""
	libdir = sysconfig.get_python_lib()
	repodir = os.path.join(libdir, "calcrepo", "repos")
	return repodir
1077748
def get_local_dist_packages_dir():
    
    import utool as ut
    if not ut.in_virtual_env():
        # Non venv case
        return get_site_packages_dir()
    else:
        candidates = []
        if ut.LINUX:
            candidates += [
                '/usr/local/lib/python2.7/dist-packages',
            ]
        else:
            raise NotImplementedError()
        for path in candidates:
            if ut.checkpath(path):
                return path
244577
def get_server_dir(self):
        
        if not self.args.server:
            if self.args.skipunzip:
                raise Stop(0, 'Unzip disabled, exiting')

            log.info('Downloading server')

            # The downloader automatically symlinks the server, however if
            # we are upgrading we want to delay the symlink swap, so this
            # overrides args.sym
            # TODO: Find a nicer way to do this?
            artifact_args = copy.copy(self.args)
            artifact_args.sym = ''
            artifacts = Artifacts(artifact_args)
            server = artifacts.download('server')
        else:
            progress = 0
            if self.args.verbose:
                progress = 20
            ptype, server = fileutils.get_as_local_path(
                self.args.server, self.args.overwrite, progress=progress,
                httpuser=self.args.httpuser,
                httppassword=self.args.httppassword)
            if ptype == 'file':
                if self.args.skipunzip:
                    raise Stop(0, 'Unzip disabled, exiting')
                log.info('Unzipping %s', server)
                server = fileutils.unzip(
                    server, match_dir=True, destdir=self.args.unzipdir)

        log.debug('Server directory: %s', server)
        return server
430142
def src_archive
      from_directory do
        Find.find(File.join("packages", name)) do |file|
          if File.file?(file) && file.match(/\.(spec)|(sh)|(patch)$/).nil?
            return File.basename(file)
          end
        end
        nil
      end
    end
155369
public function get_packages_dir_path() {
		if ( getenv( 'WP_CLI_PACKAGES_DIR' ) ) {
			$packages_dir = Utils\trailingslashit( getenv( 'WP_CLI_PACKAGES_DIR' ) );
		} else {
			$packages_dir = Utils\get_home_dir() . '/.wp-cli/packages/';
		}
		return $packages_dir;
	}
807891
def get_available_packages(dir)
      packages = Dir["#{Lyp.packages_dir}/**/*"].inject({}) do |m, p|
        entry_point_path = File.join(p, MAIN_PACKAGE_FILE)
        if File.file?(entry_point_path)
          package_name = p.gsub(/^#{Lyp.packages_dir}\//, '')
          m[package_name] = DependencyPackage.new(entry_point_path)
        end
        m
      end

      forced_paths = @opts[:forced_package_paths] || {}

      if @opts[:forced_package_paths]
        @opts[:forced_package_paths].each do |package, path|
          packages["#{package}@forced"] = DependencyPackage.new(File.join(path, MAIN_PACKAGE_FILE))
        end
      end

      packages
    end
773267
def get_download_uri(package_name, version, source, index_url=None):

    
    tmpdir = None
    force_scan = True
    develop_ok = False
    if not index_url:
        index_url = 'http://cheeseshop.python.org/pypi'

    if version:
        pkg_spec = "%s==%s" % (package_name, version)
    else:
        pkg_spec = package_name
    req = pkg_resources.Requirement.parse(pkg_spec)
    pkg_index = MyPackageIndex(index_url)
    try:
        pkg_index.fetch_distribution(req, tmpdir, force_scan, source,
                develop_ok)
    except DownloadURI as url:
        #Remove #egg=pkg-dev
        clean_url = url.value.split("#")[0]
        #If setuptools is asked for an egg and there isn't one, it will
        #return source if available, which we don't want.
        if not source and not clean_url.endswith(".egg") and \
                not clean_url.endswith(".EGG"):
            return
        else:
            return clean_url
890375
function(directory) {
    if (!this.packageJSONFinder) {
      this.packageJSONFinder = new FileFinder(PACKAGE_FILENAME);
    }

    return this.packageJSONFinder.findInDirectoryOrParentsSync(directory || process.cwd());
  }
988746
def get_libs_dir(self, arch):
        ''''''
        ensure_dir(join(self.libs_dir, arch))
        return join(self.libs_dir, arch)
560825
function getProgramDir(programFile) {
    const info = programFile.query_info('standard::', Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
    if (info.get_is_symlink()) {
      const symlinkFile = programFile.get_parent().resolve_relative_path(info.get_symlink_target());
      return symlinkFile.get_parent();
    } else {
      return programFile.get_parent();
    }
  }
947899
private static function package()
    {
        if (!self::$package) {
            self::$package = new PackageBase('cripfilesys', __DIR__);
            self::$package->publish_database = false;
            self::$package->enable_routes = false;
        }
        return self::$package;
    }
1074670
def find_subdirectories(package):
    
    try:
        subdirectories = os.walk(package_to_path(package)).next()[1]
    except StopIteration:
        subdirectories = []
    return subdirectories
779538
def get_package(self):
        
        directory = self.directory
        develop = self.develop
        scmtype = self.scmtype

        self.scm = self.scms.get_scm(scmtype, directory)

        if self.scm.is_valid_url(directory):
            directory = self.urlparser.abspath(directory)

            self.remoteurl = directory
            self.isremote = self.push = True
        else:
            directory = abspath(expanduser(directory))
            self.isremote = False

            self.scm.check_valid_sandbox(directory)
            self.setuptools.check_valid_package(directory)

            name, version = self.setuptools.get_package_info(directory, develop)
            print('Releasing', name, version)

            if not self.skipcommit:
                if self.scm.is_dirty_sandbox(directory):
                    self.scm.commit_sandbox(directory, name, version, self.push)