import re
import pycurl
import base64
import string
import simplejson as json
import ssl
import requests
from socket import *

from phabricator import Phabricator
from phabricator import APIError


phab = Phabricator()
phab.update_interfaces()
phab.timeout = 100.0

print("WHO AM I?")
print("=========")
me = phab.user.whoami()
print(me)

file_repo_url = "https://media.githubusercontent.com/media/zeroengineteam/ZeroFiles/master/doc_files/"
doc_repo_url = "https://github.com/zeroengineteam/ZeroDocs/blob/master/"

#Takes the file ID list returned by GetFileIDs and downloads all files from phabricator in a folder structure reflecting task IDs
def DownloadFileFromPhabricator(fileID):
    constraints = {}
    constraints["ids"] = [int(fileID)];
    response = None