File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66# Python Standard Library imports
77from datetime import datetime
88import json
9+ import os
910import urllib .parse
1011import sys
1112
1718import oshminer .filetypes as filetypes
1819from oshminer .errors import exceptions
1920
21+ # Set Wikifactory API URL
22+ # Looks for the `WIF_API_URL` environment variable, and if not found, default to:
23+ # https://wikifactory.com/api/graphql
24+ # See:
25+ # https://www.twilio.com/blog/environment-variables-python
26+ WIF_API_URL : str = os .environ .get ("WIF_API_URL" , "https://wikifactory.com/api/graphql" )
27+ # print(f"Wikifactory API URL: {WIF_API_URL}", file=sys.stderr)
28+
2029async def get_files_info (project : dict , session ) -> dict :
2130 # Provide a GraphQL query
2231 query = gql (
@@ -419,7 +428,7 @@ async def make_Wikifactory_request(url: str, data: list) -> str:
419428 }
420429
421430 # Select transport with the Wikifactory API endpoint URL
422- transport = AIOHTTPTransport (url = "https://wikifactory.com/api/graphql" )
431+ transport = AIOHTTPTransport (url = WIF_API_URL )
423432
424433 # Get "space" and "slug" components from this repository's URL
425434 space_slug : dict = parse_url (url )
You can’t perform that action at this time.
0 commit comments