hi,
I want to search tags from some remote repositories (https://git.XXXXX.com/projects/xxx/repos/ooo/browse), and match the tag which I want to find. Those tags are in master
so I write python as following:
-------------------------------------------------------------------------------------------
from atlassian import Bitbucket
...
bbucket = Bitbucket(url='http://localhost:80', username=username, password=password)
tag = bbucket.get_tags('xxx', 'ooo', matchTag)
...
--------------------------------------------------------------------------------------------
The first question is: I'm not sure that the "url" in Bitbucket() function has to be what kind of url? my url is right?
And the second question is: when I run this code, I'll get an error: 'unicode' object has no attribute 'get'.
Thanks a lot.
Hello @Winni_Chang,
First of all, it looks like your question is about Bitbucket Server, not Cloud – is this correct? I believe it is mistakenly tagged with cloud and bitbucket-cloud, I'll fix the tags.
Next, I'm guessing you're trying to use atlassian-python-api module – can you confirm this? It is created and maintained by a third party, and it seems to be looked after very well.
So, following the documentation of that module, the url argument for Bitbucket object constructor is a string. According to what you described, it should be something like this:
bitbucket = Bitbucket(url='https://git.XXXXX.com', username=username, password=password)
As for the error message you mentioned, unfortunately, it is not descriptive enough to say where is it thrown from and why exactly. Is there any additional hint about the line of your code or the library code which can shed some light on this?
Here's the REST endpoint get_tag() is calling btw – might be useful for figuring out what's going on.
Hope this helps.
Cheers,
Daniil
Hi Danil,
Thanks for your response.
Yes, my question is about Bitbucket Server, not Cloud. and yes I'm trying to use atlassian-python-api module.
oh. The url is like that. I'll try it. Thanks.
And last, the error is happened when get_tag() is calling. But maybe I know what happened about it now.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Danil,
Thanks a lot! I am just an idiot. I guess the url is wrong, so get_tags() function can not get anything. Then it will run 'unicode'.get() in get_tags() function. But 'unicode' type doesn't have get attribute. Thus it outputs this error.
I appreciate your help very much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cool, I'm glad it works!
No worries, always happy to help :)
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.