Skip to content

Commit

Permalink
Move asana workspace name to an environment variable
Browse files Browse the repository at this point in the history
Fixes #82
  • Loading branch information
danstis committed Aug 30, 2023
1 parent bf7c18c commit 34fcf1e
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions ado_asana_sync/sync/app.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import logging
import os
import asana
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
from tinydb import TinyDB

_LOGGER = logging.getLogger(__name__)


class App:
"""
Expand All @@ -13,11 +16,13 @@ class App:
ado_pat (str, optional): ADO Personal Access Token. Defaults to value retrieved from environment variable "ADO_PAT".
ado_url (str, optional): ADO URL. Defaults to value retrieved from environment variable "ADO_URL".
asana_token (str, optional): Asana access token. Defaults to value retrieved from environment variable "ASANA_TOKEN".
asana_workspace_name (str, optional): Asana workspace name. Defaults to value retrieved from environment variable "ASANA_WORKSPACE_NAME".
Attributes:
ado_pat (str): ADO Personal Access Token.
ado_url (str): ADO URL.
asana_token (str): Asana access token.
asana_workspace_name (str): Asana workspace name.
ado_core_client: ADO core client.
ado_work_client: ADO work client.
ado_wit_client: ADO work item tracking client.
Expand All @@ -29,21 +34,15 @@ class App:

def __init__(
self,
ado_pat=os.environ.get("ADO_PAT"),
ado_url=os.environ.get("ADO_URL"),
asana_token=os.environ.get("ASANA_TOKEN"),
ado_pat: str,
ado_url: str,
asana_token: str,
asana_workspace_name: str,
) -> None:
"""
Initializes the App object with the provided ADO PAT, ADO URL, and Asana token.
Args:
ado_pat (str, optional): ADO Personal Access Token. Defaults to value retrieved from environment variable "ADO_PAT".
ado_url (str, optional): ADO URL. Defaults to value retrieved from environment variable "ADO_URL".
asana_token (str, optional): Asana access token. Defaults to value retrieved from environment variable "ASANA_TOKEN".
"""
self.ado_pat = ado_pat
self.ado_url = ado_url
self.asana_token = asana_token
self.ado_pat = ado_pat or os.environ.get("ADO_PAT")
self.ado_url = ado_url or os.environ.get("ADO_URL")
self.asana_token = asana_token or os.environ.get("ASANA_TOKEN")
self.asana_workspace_name = asana_workspace_name or os.environ.get("ASANA_WORKSPACE_NAME")
self.ado_core_client = None
self.ado_work_client = None
self.ado_wit_client = None
Expand Down

0 comments on commit 34fcf1e

Please sign in to comment.