comparison sync_to_github.py @ 9:2c4d383d464c

move config stuff into Project
author drewp@bigasterisk.com
date Fri, 16 Jul 2021 00:19:01 -0700
parents cc3321b8adc1
children
comparison
equal deleted inserted replaced
8:cc3321b8adc1 9:2c4d383d464c
1 #!/usr/bin/python3 1 #!/usr/bin/python3
2 from pathlib import Path 2 from pathlib import Path
3 import json
4 3
5 from github import Github
6 from sync import Project, getSshAuthSock 4 from sync import Project, getSshAuthSock
7 5
8 config = json.loads(open("config.json").read()) 6 p = Project(Path('.').absolute())
9 config['SSH_AUTH_SOCK'] = getSshAuthSock()
10
11 # to get this token:
12 # curl -u drewp https://api.github.com/authorizations -d '{"scopes":["repo"]}'
13 # from http://developer.github.com/v3/oauth/#oauth-authorizations-api
14 gh = Github(config['gitHubToken']).get_user()
15
16 p = Project(config, gh, Path('.').absolute())
17 p.makeGithubRepo() 7 p.makeGithubRepo()
18 p.hgToGithub() 8 p.hgToGithub()