def _load_config(self): config_file_path = os.path.join(get_virtual_home(), '.jip') if not os.path.exists(config_file_path): config_file_path = os.path.expanduser('~/.jip') if os.path.exists(config_file_path): config = ConfigParser() config.read(config_file_path) repos = [] ## only loop section starts with "repos:" repos_sections = filter(lambda x:x.startswith("repos:"), config.sections()) for section in repos_sections: name = section.split(':')[1] uri = config.get(section, "uri") rtype = config.get(section, "type") repos.append((name, uri, rtype)) return repos else: return None
def _load_config(self): config_file_path = os.path.join(get_virtual_home(), '.jip') if not os.path.exists(config_file_path): config_file_path = os.path.expanduser(os.path.join('~', '.jip')) if os.path.exists(config_file_path): config = ConfigParser() config.read(config_file_path) repos = [] ## only loop section starts with "repos:" repos_sections = filter(lambda x:x.startswith("repos:"), config.sections()) for section in repos_sections: name = section.split(':')[1] uri = config.get(section, "uri") rtype = config.get(section, "type") repos.append((name, uri, rtype)) return repos else: return None
def __init__(self): self.name = 'cache' self.uri = os.path.expanduser(os.path.join(get_virtual_home(), '.jip', 'cache')) if not os.path.exists(self.uri): os.makedirs(self.uri)
for artifact in remembered_libs: local_name = artifact.to_jip_name() if local_name not in in_path_libs: logger.warn(('[Warning] %s is not in your path which should be installed by previous actions. ' + 'If you still need it, please reinstall it by: jip install %s') % (local_name, str(artifact))) self.remove_artifact(artifact) def finalize(self): self.persist() def commit(self): self.committed = True def to_pom(self): pom_template = Template(""" <dependency> <groupId>$groupId</groupId> <artifactId>$artifactId</artifactId> <version>$version</version> </dependency>""") deps = [] for artifact in self.installed: content = pom_template.substitute({'groupId': artifact.group, 'artifactId': artifact.artifact, 'version': artifact.version}) deps.append(content) return ''.join(deps) index_manager = IndexManager(os.path.join(get_virtual_home(), '.jip_index'))
'If you still need it, please reinstall it by: jip install %s' ) % (local_name, str(artifact))) self.remove_artifact(artifact) def finalize(self): self.persist() def commit(self): self.committed = True def to_pom(self): pom_template = Template(""" <dependency> <groupId>$groupId</groupId> <artifactId>$artifactId</artifactId> <version>$version</version> </dependency>""") deps = [] for artifact in self.installed: content = pom_template.substitute({ 'groupId': artifact.group, 'artifactId': artifact.artifact, 'version': artifact.version }) deps.append(content) return ''.join(deps) index_manager = IndexManager(os.path.join(get_virtual_home(), '.jip_index'))
def __init__(self): self.name = 'cache' self.uri = os.path.expanduser( os.path.join(get_virtual_home(), '.jip', 'cache')) if not os.path.exists(self.uri): os.makedirs(self.uri)