Code Monkey home page Code Monkey logo

Comments (4)

foster82 avatar foster82 commented on June 6, 2024 2

great thanks that has helped to a degree , what i am looking do do though is hide this out put. Is that possible? Just need to show an authentication error.

from atlassian-python-api.

gonchik avatar gonchik commented on June 6, 2024 1

Hi!

Sorry for the delay, from atlassian import Confluence
I am using like this

import config
import pprint
import logging

CONFLUENCE_URL = config.CONFLUENCE_URL
CONFLUENCE_LOGIN = config.CONFLUENCE_LOGIN
CONFLUENCE_PASSWORD = config.CONFLUENCE_PASSWORD

logging.basicConfig(level=logging.ERROR)

if __name__ == '__main__':
    confluence = Confluence(
        url=CONFLUENCE_URL,
        username=CONFLUENCE_LOGIN,
        password='blablabla'
    )
    pprint.pprint(confluence.cql('text ~ gonchik'))

then output will be like this
image

Otherwise we can implement other exception module.

Cheers,
Gonchik Tsymzhitov

from atlassian-python-api.

gonchik avatar gonchik commented on June 6, 2024 1

@Woklex Thanks for that.
| have implemented here as well
dfd882b

from atlassian-python-api.

Woklex avatar Woklex commented on June 6, 2024

You can just throw a request and check that we are fine.

    confluence = Confluence(
        url=CONFLUENCE_URL,
        username=CONFLUENCE_LOGIN,
        password='blablabla'
    )
    out = confluence.request()
    if out.status_code == 200:
        confluence.cql('text ~ Wubba lubba dub dub!'))
    elif out.status_code == 401:
        print("AUTHENTICATED_FAILED")
    else:
        print("Another error. Do something.")

from atlassian-python-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.