Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change PYCONFLUENCE_ORG to BASE_URL #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
change PYCONFLUENCE_ORG to BASE_URL
潘志同 committed Oct 17, 2017
commit d91eeae3a187c5c641c13a333018affadc78bc68
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ environment variables. Here's the step-by-step process:

export PYCONFLUENCE_TOKEN=[password for Confluence account]

export PYCONFLUENCE_ORG=[organization name; found in "https://[org].atlassian.net/wiki/..." URL]
export BASE_URL=[url of your Confluence website]

3. Save the file, then add this to ".bash_profile" in your home directory ("~/.bash_profile"):

5 changes: 2 additions & 3 deletions pyconfluence/api.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ def load_variables():
"""Load variables from environment variables."""
if (not os.environ.get("PYCONFLUENCE_TOKEN") or
not os.environ.get("PYCONFLUENCE_USER") or
not os.environ.get("PYCONFLUENCE_ORG")):
not os.environ.get("BASE_URL")):
print ("One or more pyconfluence environment variables are not set. "
"See README for directions on how to resolve this.")
sys.exit("Error")
@@ -32,8 +32,7 @@ def load_variables():
global base_url
token = os.environ["PYCONFLUENCE_TOKEN"]
user = os.environ["PYCONFLUENCE_USER"]
base_url = ("https://" + os.environ["PYCONFLUENCE_ORG"] + ".atlassian"
".net/wiki/rest/api/content")
base_url = (os.environ["BASE_URL"] + "/wiki/rest/api/content")


def rest(url, req="GET", data=None):