Page 53 of 58 FirstFirst ... 3435152535455 ... LastLast
Results 521 to 530 of 572

Thread: Conky Rhythmbox Python Script

  1. #521
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by kaivalagi View Post
    Your issue with the image not changing sounds like the conky $image variable is caching rather than refetching the /tmp/cover image, either add a "-n" to the image variable options or set the image cache (can't recall the config setting needed above TEXT line, check the conky documentation at http://conky.sourceforge.net/documentation.html) to 0
    @ Neon612:

    Code:
    imlib_cache_size 0

  2. #522
    Join Date
    Feb 2008
    Beans
    145
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by kaivalagi View Post
    Nice one! Maybe you should get on board with the conky companions PPA side of things with the conkySongbird script!
    I'd love to but ... uh ... how?

    Quote Originally Posted by kaivalagi View Post
    Can you post the script, details on the fix for the unicode side of things and the conkyrc as I'll see what can be done in the other music player scripts to handle Russian (and other) characters...
    Attached file.
    The unicode fix is just a dict where each set of hex values are mapped to their equivalent Cyrillic character. I'm sure there is a better way to do it, but this is what I got working for me.

    The dict is inside a function (russify... original right?) the loops through every key/value pair, replacing the hex mess with the right char. I'm guessing that other characters could be added by just extending the dict.

    The linking of the cover image I removed (commented out) and converted it to reading from the mp3 tags, using the eyeD3 python library. It retrieves the image data, opens /tmp/cover and outputs the data into the file.

    Quote Originally Posted by kaivalagi View Post
    Your issue with the image not changing sounds like the conky $image variable is caching rather than refetching the /tmp/cover image, either add a "-n" to the image variable options or set the image cache (can't recall the config setting needed above TEXT line, check the conky documentation at http://conky.sourceforge.net/documentation.html) to 0
    Thanks, the -n flag fixed things.

    Quote Originally Posted by Sector11 View Post
    Stolen? Oh my! CCCC'd maybe but stolen; never.
    Hey, if it works ... it's good.

    Ahhhhhhhh no wonder I don't know what it is - Songbird is a MacWindows app!
    C4'd!!

    Actually, Songbird started out as a crossplatform music player from mozilla. They eventually discontinued the linux version as official releases but most of their developers are using linux so it is still possible to get a linux edition.
    Attached Files Attached Files

  3. #523
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by Neon612 View Post
    I'd love to but ... uh ... how?
    Firstly thanks very much for your efforts so far, it's nice when someone is willing to take on a little development and aid the cause!

    You'd be best understanding an existing branch layout etc including the bazaar and aur folders and what they do for builds

    Once you have that nailed then get to grips with bazaar (versioning) and we can see to get you added to the team members so you can init/commit and push a branch up

    Once the code and support files are looking right on the bazaar server we have a script you can use to pull down source, do a debian source package and upload to launchpad for building...this forms the start of package creation for ubuntu/debian etc.

    Probably some details you need to get to grips with there...PM me for help on it, either way if it were me I would start by understanding an existing code branch and all that it entails...conkyRhythmbox might be a good choice

    Quote Originally Posted by Neon612 View Post
    Attached file.
    The unicode fix is just a dict where each set of hex values are mapped to their equivalent Cyrillic character. I'm sure there is a better way to do it, but this is what I got working for me.

    The dict is inside a function (russify... original right?) the loops through every key/value pair, replacing the hex mess with the right char. I'm guessing that other characters could be added by just extending the dict.
    Mmmmm, not so keen on this as it would require handling all sorts of characters as and when they turn up - what happens when some polish / chinese / swedish songs need support.

    There must be something that does the job properly - you would hope anyway. For example I used urllib.unquote to handle anything in the past...but this must have issue with Russian chars....? I thought it coped but as I had issue with getting a coverart path in the first place so couldn't be sure...maybe I should try the Russian songs with a player such as Exaile to see how the code fairs...all needs time though which is in limited supply

    I would be interested if your line here:
    Code:
    taglocation = self.russify(location.replace('file://', '').replace('%20', ' ')).encode('utf-8')
    would still work if like this:
    Code:
    taglocation = urllib.unquote(location).replace("file://", "").encode("utf-8")
    Quote Originally Posted by Neon612 View Post
    The linking of the cover image I removed (commented out) and converted it to reading from the mp3 tags, using the eyeD3 python library. It retrieves the image data, opens /tmp/cover and outputs the data into the file.
    I used this same method with other scripts where I can handle the track change event in dbus (not implemented by RB and working)...take a look at the conkyExaile-GetCoverart.py script as part of conkyExaile for an example of what I mean...it uses this along with other methods to try and get coverart sorted.

    MP3 image tag functions used on thier own wont support much as most mp3's I have (and lots of others I suspect) don't include embedded images and I for one don't want them to....

    Quote Originally Posted by Neon612 View Post
    Thanks, the -n flag fixed things.
    No worries

    Sorry if I am coming across as a picky a$$hole, I don't mean to provoke etc, I am always looking for the longer term all encompassing solution so no more work will be required as the rolling out of a package update can be slow going and I like to minimise that

    I hope you get where I am coming from with all this and maybe you have some ideas that would fit with my ideals...all help is appreciated even if it might not come across that way

    edit: I wish rhythmbox would fetch cover art paths for me in the first place...then I could test this thing properly
    Last edited by kaivalagi; May 31st, 2011 at 07:20 PM.

  4. #524
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by kaivalagi View Post
    Sorry if I am coming across as a picky a$$hole, I don't mean to provoke etc, I am always looking for the longer term all encompassing solution so no more work will be required as the rolling out of a package update can be slow going and I like to minimise that

    I hope you get where I am coming from with all this and maybe you have some ideas that would fit with my ideals...all help is appreciated even if it might not come across that way
    {hands on hips} now now Mr K. you have never come across that way. You should have a little more faith in yourself. I sure do!

    If I could code, I'd be right in there as thick as I am into conky. But alas, all I can do is beta test things and help that way. I'd love to take some of the workload off your shoulders. I'm still looking for a nice Python Book to buy. may have to wait until later this year when I head north for a holiday.

  5. #525
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Rhythmbox Python Script

    I just had a thought, if Rhythmbox and, VLC can see the cover art and display the songs with the proper "characters" why can't that type of coding be used.



    Easy to tell I'm not a programmer huh.

  6. #526
    Join Date
    Feb 2008
    Beans
    145
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by kaivalagi View Post
    Firstly thanks very much for your efforts so far, it's nice when someone is willing to take on a little development and aid the cause!

    You'd be best understanding an existing branch layout etc including the bazaar and aur folders and what they do for builds

    Once you have that nailed then get to grips with bazaar (versioning) and we can see to get you added to the team members so you can init/commit and push a branch up

    Once the code and support files are looking right on the bazaar server we have a script you can use to pull down source, do a debian source package and upload to launchpad for building...this forms the start of package creation for ubuntu/debian etc.

    Probably some details you need to get to grips with there...PM me for help on it, either way if it were me I would start by understanding an existing code branch and all that it entails...conkyRhythmbox might be a good choice
    I'll have to get back to you on this. I read it over and my eyes just sort of glazed over. I'll take a look and see what I can learn. DO you happen to have any links to point me in the right direction?

    Thanks.


    Quote Originally Posted by kaivalagi View Post
    Mmmmm, not so keen on this as it would require handling all sorts of characters as and when they turn up - what happens when some polish / chinese / swedish songs need support.

    There must be something that does the job properly - you would hope anyway. For example I used urllib.unquote to handle anything in the past...but this must have issue with Russian chars....? I thought it coped but as I had issue with getting a coverart path in the first place so couldn't be sure...maybe I should try the Russian songs with a player such as Exaile to see how the code fairs...all needs time though which is in limited supply

    I would be interested if your line here:
    Code:
    taglocation = self.russify(location.replace('file://', '').replace('%20', ' ')).encode('utf-8')
    would still work if like this:
    Code:
    taglocation = urllib.unquote(location).replace("file://", "").encode("utf-8")
    The unquote will take us right back to the beginning. I'm noticing that the filestrings are set up as two hex digits. Something like %d0%ae, and then after the unquote it treats each percent symbol as separate characters. So instead of one character coming out (\xd0\xae) we get two (\xd0 and \xae). If there is a way to convert the %d0%ae into its unicode number, that should at least be closer to working the right way.


    Quote Originally Posted by kaivalagi View Post
    Sorry if I am coming across as a picky a$$hole, I don't mean to provoke etc, I am always looking for the longer term all encompassing solution so no more work will be required as the rolling out of a package update can be slow going and I like to minimise that

    I hope you get where I am coming from with all this and maybe you have some ideas that would fit with my ideals...all help is appreciated even if it might not come across that way

    edit: I wish rhythmbox would fetch cover art paths for me in the first place...then I could test this thing properly
    No worry there. I'm sort of the same way, a perfectionist at heart that is more worried about code working then just for the sake of getting it out there.
    Last edited by Neon612; May 31st, 2011 at 09:37 PM.

  7. #527
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by Neon612 View Post
    I'll have to get back to you on this. I read it over and my eyes just sort of glazed over. I'll take a look and see what I can learn. DO you happen to have any links to point me in the right direction?

    Thanks.
    Install "bazaar" or "bzr", run this somewhere suitable in the terminal and look at the contents:

    Code:
    bzr branch lp:~conky-companions/+junk/conkyrhythmbox
    Pay special attention to the "debian" folder and it's contents as well as the setup.py and changelog file

    I learnt from example / trial error so I can't really point you towards any docs. Once you get the local files side of things sussed I can help with bzr command usage and launchpad setup (need a login and pgp/ssh keys setup for auth)

    Quote Originally Posted by Neon612 View Post
    The unquote will take us right back to the beginning. I'm noticing that the filestrings are set up as two hex digits. Something like %d0%ae, and then after the unquote it treats each percent symbol as separate characters. So instead of one character coming out (\xd0\xae) we get two (\xd0 and \xae). If there is a way to convert the %d0%ae into its unicode number, that should at least be closer to working the right way.
    Mmmmm, maybe unquote will work if python knows to play nice with unicode in the first place, using something like sys.setdefaultencoding() could help but on further reading it looks like different encoding methods might be needed for different character sets, e.g. iso-8859-1 for some latin types and koi8-r for Russian...

    To be honest if I can't find a dynamic way of handling everything nicely then it wont handle it at all...you can only please some of the people some of the time

    Quote Originally Posted by Neon612 View Post
    No worry there. I'm sort of the same way, a perfectionist at heart that is more worried about code working then just for the sake of getting it out there.
    I do this in my day job except it's java or .net....you'd think I would leave this stuff well alone when I come home....some of the time I do wonder why I do it

  8. #528
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by Sector11 View Post
    I just had a thought, if Rhythmbox and, VLC can see the cover art and display the songs with the proper "characters" why can't that type of coding be used.



    Easy to tell I'm not a programmer huh.
    I think you may have just hit the nail on the head, I need to start looking at some of the python source code for some of the players (RB and VLC are not python though)....when I find the time that is!

  9. #529
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by kaivalagi View Post
    I think you may have just hit the nail on the head, I need to start looking at some of the python source code for some of the players (RB and VLC are not python though)....when I find the time that is!
    I'm outside the box looking in, sometimes I see might something that a programmer might over look. BTW, GMusicBrowser is a perl script and it has no problem either:


    Maybe that will be easier.

    OR - are you ready for this ..... Ta da!

    Music software written in Python
    Last edited by Sector11; May 31st, 2011 at 11:23 PM.

  10. #530
    Join Date
    Feb 2008
    Beans
    145
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Conky Rhythmbox Python Script

    Quote Originally Posted by kaivalagi View Post
    Mmmmm, maybe unquote will work if python knows to play nice with unicode in the first place, using something like sys.setdefaultencoding() could help but on further reading it looks like different encoding methods might be needed for different character sets, e.g. iso-8859-1 for some latin types and koi8-r for Russian...

    To be honest if I can't find a dynamic way of handling everything nicely then it wont handle it at all...you can only please some of the people some of the time
    I feel like I've just been hit over the head. The fix is so simple (I hope it works for more than russian characters, I can't test it).

    Simply change:
    Code:
    location = props["location"]
    to
    Code:
    location = props["location"].encode('utf-8')
    And change
    Code:
    taglocation = urllib.unquote(location).replace("file://", "").encode("utf-8")
    to
    Code:
    taglocation = urllib.unquote(location).replace("file://", "")


    And my russify function is not even needed

Page 53 of 58 FirstFirst ... 3435152535455 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •