From d91eeae3a187c5c641c13a333018affadc78bc68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E5=BF=97=E5=90=8C?= Date: Tue, 17 Oct 2017 16:26:16 +0800 Subject: [PATCH 1/3] change PYCONFLUENCE_ORG to BASE_URL --- README.rst | 2 +- pyconfluence/api.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index b6070a3..60c3954 100644 --- a/README.rst +++ b/README.rst @@ -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"): diff --git a/pyconfluence/api.py b/pyconfluence/api.py index 57ba315..cec22df 100644 --- a/pyconfluence/api.py +++ b/pyconfluence/api.py @@ -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): From 9b33f503b755cbcfb470d027953e49fad87d4e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E5=BF=97=E5=90=8C?= Date: Tue, 17 Oct 2017 19:04:28 +0800 Subject: [PATCH 2/3] rm /wiki from url --- .../markdown-navigator/profiles_settings.xml | 3 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/pyconfluence.iml | 11 + .idea/vcs.xml | 6 + .idea/workspace.xml | 687 ++++++++++++++++++ pyconfluence/api.py | 2 +- 7 files changed, 720 insertions(+), 1 deletion(-) create mode 100644 .idea/markdown-navigator/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/pyconfluence.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/markdown-navigator/profiles_settings.xml b/.idea/markdown-navigator/profiles_settings.xml new file mode 100644 index 0000000..57927c5 --- /dev/null +++ b/.idea/markdown-navigator/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..370530d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..4b6cffc --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/pyconfluence.iml b/.idea/pyconfluence.iml new file mode 100644 index 0000000..d6c1d4e --- /dev/null +++ b/.idea/pyconfluence.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..fc2aa49 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,687 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PYCONFLUENCE_ORG + PYCONFLUENCE_TEST_SPACE + space + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1508226491786 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pyconfluence/api.py b/pyconfluence/api.py index cec22df..74321a2 100644 --- a/pyconfluence/api.py +++ b/pyconfluence/api.py @@ -32,7 +32,7 @@ def load_variables(): global base_url token = os.environ["PYCONFLUENCE_TOKEN"] user = os.environ["PYCONFLUENCE_USER"] - base_url = (os.environ["BASE_URL"] + "/wiki/rest/api/content") + base_url = (os.environ["BASE_URL"] + "/rest/api/content") def rest(url, req="GET", data=None): From e018abb9686c76b489d6aefbf8aeee25ccd24026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E5=BF=97=E5=90=8C?= Date: Tue, 17 Oct 2017 19:06:08 +0800 Subject: [PATCH 3/3] add .idea in gitignore --- .gitignore | 1 + .../markdown-navigator/profiles_settings.xml | 3 - .idea/misc.xml | 4 - .idea/modules.xml | 8 - .idea/pyconfluence.iml | 11 - .idea/vcs.xml | 6 - .idea/workspace.xml | 687 ------------------ 7 files changed, 1 insertion(+), 719 deletions(-) delete mode 100644 .idea/markdown-navigator/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/pyconfluence.iml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.gitignore b/.gitignore index 1d8cea1..09bd5d4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ tests.py *.egg-info/ dist/ pyconfluence/__pycache__/ +.idea/ diff --git a/.idea/markdown-navigator/profiles_settings.xml b/.idea/markdown-navigator/profiles_settings.xml deleted file mode 100644 index 57927c5..0000000 --- a/.idea/markdown-navigator/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 370530d..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 4b6cffc..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/pyconfluence.iml b/.idea/pyconfluence.iml deleted file mode 100644 index d6c1d4e..0000000 --- a/.idea/pyconfluence.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index fc2aa49..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,687 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PYCONFLUENCE_ORG - PYCONFLUENCE_TEST_SPACE - space - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1508226491786 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file