Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master wand by Vlad Glagolev (61ef62848d9888ed9824046abb0a5c67f24725cb)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master wand by Vlad Glagolev (61ef62848d9888ed9824046abb0a5c67f24725cb)
  • Date: Sat, 23 May 2020 18:11:20 +0000

GIT changes to master wand by Vlad Glagolev <stealth AT sourcemage.org>:

remirror/remirror | 15 ++++-----------
remirror/remirror.config.yaml | 1 +
2 files changed, 5 insertions(+), 11 deletions(-)

New commits:
commit 61ef62848d9888ed9824046abb0a5c67f24725cb
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

Sourcehut: switch to API calls

diff --git a/remirror/remirror b/remirror/remirror
index 213b1ce..f0f629b 100755
--- a/remirror/remirror
+++ b/remirror/remirror
@@ -37,7 +37,7 @@ except ImportError:
HAS_REQUESTS = False


-__version__ = "0.0.2" # major.minor.revision
+__version__ = "0.0.3" # major.minor.revision


# ~/.sourcemage/mirror.yaml
@@ -46,7 +46,7 @@ _DEFAULT_CONFIG = os.path.join(os.path.expanduser("~"),
".sourcemage/mirror.yaml
_CONFIG_FORMAT = {
'root': '',
'projects': ('name', 'repos'),
- 'mirrors': ('name', 'username')
+ 'mirrors': ('name', 'username', 'token')
}

PROVIDERS = {
@@ -324,28 +324,21 @@ class ProviderBitbucket(Provider):

class ProviderSourcehut(Provider):
api_url = "https://git.sr.ht/api/";
- web_url = "https://git.sr.ht/";
git_host = "git AT git.sr.ht"

def __init__(self, conf):
super(ProviderSourcehut, self).__init__(conf)

+ self.auth = {'headers': {"Authorization": "token %s" %
self.conf['token']}}
self.group = '~' + self.conf.get('organization')

def sanity_check(self, repo):
- repo_ok = "/{0}/{1}/".format(self.group, repo.name)
+ repo_ok = "/{0}/repos/{1}".format(self.group, repo.name)

req = self.http_call(repo_ok)

req.raise_for_status()

- def http_call(self, url):
- req_url = self.web_url + url.lstrip('/')
-
- req = requests.get(req_url)
-
- return req
-

def mirror(conf):
queue = Queue()
diff --git a/remirror/remirror.config.yaml b/remirror/remirror.config.yaml
index 38e6b2f..1809d35 100644
--- a/remirror/remirror.config.yaml
+++ b/remirror/remirror.config.yaml
@@ -60,4 +60,5 @@ mirrors:

- name: sourcehut
username: magesync
+ token: secret
organization: sourcemage



  • [SM-Commit] GIT changes to master wand by Vlad Glagolev (61ef62848d9888ed9824046abb0a5c67f24725cb), Vlad Glagolev, 05/23/2020

Archive powered by MHonArc 2.6.24.

Top of Page