invoke phabtalk standalone
This commit is contained in:
parent
06c97f1dc5
commit
7aebf9d969
1 changed files with 12 additions and 0 deletions
|
@ -19,6 +19,7 @@ Interactions with Phabricator.
|
||||||
import logging
|
import logging
|
||||||
from typing import Optional, List, Dict
|
from typing import Optional, List, Dict
|
||||||
import uuid
|
import uuid
|
||||||
|
import argparse
|
||||||
|
|
||||||
import backoff
|
import backoff
|
||||||
from phabricator import Phabricator
|
from phabricator import Phabricator
|
||||||
|
@ -184,3 +185,14 @@ class Report:
|
||||||
|
|
||||||
def add_artifact(self, dir: str, file: str, name: str):
|
def add_artifact(self, dir: str, file: str, name: str):
|
||||||
self.artifacts.append({'dir': dir, 'file': file, 'name': name})
|
self.artifacts.append({'dir': dir, 'file': file, 'name': name})
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description='Sample interaction with Phabricator')
|
||||||
|
parser.add_argument('--url', type=str, dest='url', default='https://reviews.llvm.org/api/')
|
||||||
|
parser.add_argument('--token', type=str, dest='token', default=None, required=True)
|
||||||
|
parser.add_argument('--diff_id', type=str, dest='diff_id', default=None, required=True)
|
||||||
|
args = parser.parse_args()
|
||||||
|
phabtalk = PhabTalk(args.token, args.url, False)
|
||||||
|
print(phabtalk.get_revision_id(args.diff_id))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue