1
0
Fork 0

invoke phabtalk standalone

This commit is contained in:
Mikhail Goncharov 2021-04-27 11:58:55 +02:00
parent 06c97f1dc5
commit 7aebf9d969

View file

@ -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))