From 3a8cc83cbe465b798647b92357eff2d52454f3dc Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 16 Feb 2020 19:35:47 -0300 Subject: Squashed commit of the following: * Move things around a bit more * Add project structure details to HACKING.md * Create setup.py * Split off A Boneless Datastructure Language --- ganarchy/__init__.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'ganarchy/__init__.py') diff --git a/ganarchy/__init__.py b/ganarchy/__init__.py index 0f13b44..6d24994 100644 --- a/ganarchy/__init__.py +++ b/ganarchy/__init__.py @@ -32,7 +32,7 @@ import requests from collections import defaultdict from urllib.parse import urlparse -import ganarchy.config +import ganarchy.config as m_ganarchy_config MIGRATIONS = { "toml-config": ( @@ -210,10 +210,8 @@ def get_env(): env.filters['tomle'] = env.filters['tomlescape'] return env - -@click.group() -def ganarchy(): - pass +# FIXME +from ganarchy.cli import main as ganarchy @ganarchy.command() def initdb(): @@ -457,12 +455,11 @@ class Config: # TODO re.compile("(^" + "|^".join(map(re.escape, domains)) + "|" + "|".join(map(re.escape, suffixes) + ")$") if base: # FIXME is remove=remove the right thing to do? - self._update_projects(base.projects, remove=remove, sanitize=False) # already sanitized - projects = config_data.get('projects', {}) - self._update_projects(projects, remove=remove) + self._update_projects({'projects': base.projects}, remove=remove, sanitize=False) # already sanitized + self._update_projects(config_data, remove=remove) def _update_projects(self, projects, remove, sanitize=True): - m = (ganarchy.config.CONFIG_PATTERN_SANITIZE if sanitize else ganarchy.config.CONFIG_PATTERN).match(projects) + m = (m_ganarchy_config.CONFIG_REPOS_SANITIZE if sanitize else m_ganarchy_config.CONFIG_REPOS).match(projects) for v in m: commit, repo_url, branchname, options = v['commit'][0], v['url'][0], v['branch'][0], v['branch'][1] try: -- cgit 1.4.1