/srv/irclogs.ubuntu.com/2010/08/22/#ayatana.txt

tvstHi, I'm the developer of Cardapio (https://launchpad.net/cardapio) and I was wondering if someone could answer some questions about the Appmenu applet02:04
tvstMainly, this is the problem that I'm encountering: https://bugs.launchpad.net/cardapio/+bug/603795/comments/602:05
ubot5Launchpad bug 603795 in Cardapio "Cardapio don't show on panel when new "Appmenu" Applet is activated (affected: 1, heat: 10)" [High,Confirmed]02:05
Omegatvst: This channel isn't very active, but someone capable of answering should see it.02:18
tvstomega: do you know what is the best way to get someone's attention on this? I'm sure the solution to this problem is known by the ayatana developers, as the default Ubuntu menu isn't affected by it...02:20
OmegaI'd say here, and maybe try their mailing list (I don't know about their policies about that though)02:20
gambsYou might like to try when it's not... 2 AM for most Canonical employees ;)02:26
tvstPoint taken :)02:31
tvstI will try again tomorrow at a more european-friendly hour02:31
tvst(or south-african)02:32
jcastrohi dashua03:41
jcastrolong time. :)03:41
OmegaHey guys.03:46
dashuaHey jcastro, how ya been?03:50
jcastrohi Omega03:50
dashuaKiller ink, contemplating my next piece :)03:50
OmegaThe cardapio dev came in and asked a few things earlier.03:51
=== bilalakhtar is now known as bilalakhtar_
sensegood morning11:45
bilalakhtarsense: Good morning to you too!11:55
sensehi bilalakhtar11:56
bilalakhtarhi sense11:56
bilalakhtarIs it true that the Ubuntu Font Beta was opened for everyone?14:25
bilalakhtarsabdfl just mailed on the list, but I still don't believe that it wasn't opened, since I saw the comments on thw ebupd8 page14:25
vishbilalakhtar: just because someone published on webupd8 doesnt mean it is open ;)14:27
bilalakhtarvish: But so many people on the page have commented that they like the font and they are using it!14:28
vishbilalakhtar: open teams were accidentally allowed ...14:28
bilalakhtarvish: Including Ubuntu Women14:28
bilalakhtarvish: And Accessibility14:28
bilalakhtarvish: And Kubuntu Users (originally)14:29
bilalakhtarSo bad! I just became an Ubuntu Member and this had to happen!14:29
* vish noticed that and did point out in UW team , but i dint really think it would be an error..14:29
vishbilalakhtar: also , the artwork team is open ;p14:30
bilalakhtarHow did such a big 'accidental' change take place!14:30
vishbilalakhtar: because no one is as perfect as you... :)14:31
* bilalakhtar would like to say that no human being is perfect14:31
tvstHey all. I am the developer for an app called Cardapio, and I was wondering if someone here could help me debug an AppMenu issue.21:11
tvstIn a nutshell, this is the problem: https://bugs.launchpad.net/cardapio/+bug/603795/comments/621:12
ubot5Launchpad bug 603795 in Cardapio "Cardapio don't show on panel when new "Appmenu" Applet is activated (affected: 1, heat: 10)" [High,Confirmed]21:12
jcastrotvst: you're looking for either tedg or bratsche, but they're usually not around on weekends21:15
jcastrohowever someone from cardapio did post on the mailing list21:15
bratscheYeah, I can help you with that.21:16
bratschetvst ^21:16
tvstYes, that was Jan-Christoph. But from the looks of it, that mailing list doesn't seem to be the right one for that, as it seems to be used mainly for announcements. Sorry if we posted in the wrong place.21:16
tvstbratsche, great!21:16
OmegaI'm sorry too for suggesting the mailing list.21:17
bratschetvst: So, the issue is that appmenu-gtk does some kind of janky things with menubars and you probably don't want to export your menubars to the appmenu.21:17
tvstso, for starters, do you understand the problem? in one line: "cardapio doesn't show when appmenu is present"21:17
jcastrothe list is the right place, it's just people usually don't ask21:17
OmegaAh.21:17
OmegaI revoke my apology in that case!21:18
tvsthaha21:18
bratscheGive me a sec to get you a proper answer.21:18
tvstsure!21:18
bratschetvst: Try running your app(let) with UBUNTU_MENUPROXY="" set in the environment.21:20
tvstok, just a sec.21:20
bratscheAnd if that works, then setenv() that in the beginning of your main() or something.21:21
bratscheHey jcastro, how's it going dude?21:21
tvstit seems i have to install appmenu on this computer. this will take a minute or two.21:21
bratscheAre you using Meerkat or Lucid?21:21
tvstlucid21:22
jcastrobratsche: pretty good, you?21:22
bratscheYou might need to install a PPA to get it on Lucid.21:22
jcastrobratsche: spending some time doing stackexchange stuff21:22
tvstbut others were complaining about the same problem on meerkat21:22
tvstoh, i know. i'm doing that right now.21:22
tvstjust to be sure: are these the correct instructions? https://bugs.launchpad.net/cardapio/+bug/603795/comments/321:23
ubot5Launchpad bug 603795 in Cardapio "Cardapio don't show on panel when new "Appmenu" Applet is activated (affected: 1, heat: 10)" [High,Confirmed]21:23
bratscheYeah, that should be fine.21:23
bratschetvst: When you show the appmenu, it attempts to hide the menubar in your app.  Of course, it's expecting your app to be a normal window-based one.  Perhaps I could add some code in there to ensure that the toplevel is a GtkWindow.21:24
bratscheBut either way, I'd recommend trying to run your applet with UBUNTU_MENUPROXY=""21:25
tvstThat would be a good idea. But for now the environment variable (if it works) is a good solution21:25
bratschejcastro: Nice.. I'm trying to do some crazy auto-fu hackery here.21:26
bratschejcastro: I got kind of sunburned last week.  It still fucking hurts. :/21:26
bratscheAlthough it's getting better now.21:26
bratschejcastro: Oh oh oh.. and I got to see Phish live last Tuesday!  It was fucking awesome!  It was actually, by FAR, the best live show I've ever seen.  By anyone.  Ever. :)21:28
bratscheThey have the most impressive light show of any band ever.21:28
tvstweird this seems to have stopped happening, even without the environment variable. i'll try logging off and then back on...21:28
tvstbrb21:28
tvstlol i forgot to write down the environment variable before logging off, so can you repost it here please? :o)21:31
bratscheUBUNTU_MENUPROXY21:31
tvstshould I set it to 1?21:31
tvstor something?21:31
bratscheThat's fine.21:32
bratscheOr just ""21:32
tvstworks!!21:34
tvstgreat!21:35
tvstI knew it would be simple :)21:35
tvstThanks bratsche21:35
bratschetvst: Nice!  So I'd recommend just doing unsetenv ("UBUNTU_MENUPROXY") in your main() function before you run the gtk mainloop.21:35
bratscheOr maybe you can communicate that to whoever maintains this app.21:36
bratscheif that's not you21:36
tvstAh, I see. Otherwise whenever Cardapio launches an app it will have a menu. Ok, I'll unset it.21:37
bratscheOh, it's all in Python.  I'm not sure what the Python equivalent of unsetenv() is.  Maybe it's still unsetenv().21:39
tvstos.unsetenv :)21:39
tvstbut it doesn't seem to do what it's supposed to. wait a sec...21:40
tvsthmm... os.unsetenv is totally not working. it simply doesn't unset the variable.21:43
tvstlooking for a solution online21:43
Omegaos.environ.clear()21:46
jcastrobratsche: I got burned too when I went to san diego, I am peel city21:48
tvstclear() is not a good idea, because the user may have something important there (and cardapio relies on other environment variables).21:48
jcastrotvst: when you're sorted can you please update the bug with the solution, I'd like to be able to point other app developers there who might run into the same problem21:49
Omegawell pop()21:49
tvsti'm using os.environ.pop('UBUNTU_MENUPROXY') and while this *does* remove the variable from the environment it *doesn't* produce the correct result.21:49
tvstThat is, AppMenu still shows the menu for apps launched by Cardapio even when there's no UBUNTU_MENUPROXY variable.21:50
bratscheTry environ['UBUNTU_MENUPROXY'] = ''21:50
tvstdoesn't work either...21:50
tvststrange.21:51
bratscheWhen I run python in a terminal it works.21:52
bratsche>>> import os21:52
bratsche>>> os.environ['UBUNTU_MENUPROXY']21:52
bratsche'libappmenu.so'21:52
bratsche>>> os.environ['UBUNTU_MENUPROXY'] = ''21:52
bratsche>>> os.environ['UBUNTU_MENUPROXY']21:52
bratsche''21:52
bratscheI don't really know Python though, so maybe this isn't doing what I think.21:53
tvstWhat I mean is that by setting os.environ['UBUNTU_MENUPROXY'] = '' is how I got the initial bug sorted out in the first place. This is because you told me setting UBUNTU_MENYPROXY = '' was sufficient (and it is!)21:54
tvstThe problem is that now there's another bug (the first one is solved).21:54
bratscheOh okay.21:54
Omega>>> os.environ['UBUNTU_MENUPROXY'] = 'test'21:54
Omega>>> os.environ['UBUNTU_MENUPROXY']21:54
Omega'test'21:54
Omega>>> os.environ.pop('UBUNTU_MENUPROXY')21:54
Omega'test'21:54
Omega>>> os.environ['UBUNTU_MENUPROXY']21:54
OmegaTraceback (most recent call last):21:54
tvstOn this second bug, any app that is launched by Cardapio gets ignored by AppMenu.21:54
Omega  File "<stdin>", line 1, in <module>21:54
Omega  File "/usr/lib/python2.6/UserDict.py", line 22, in __getitem__21:54
Omega    raise KeyError(key)21:54
OmegaKeyError: 'UBUNTU_MENUPROXY'21:54
Omegapop works fine here21:54
bratschejcastro: I'm not peeling.. just my feet and ankles are swollen and hurt like crazy.21:55
tvstAgain, the second bug is that any app that is launched by Cardapio gets ignored by AppMenu. This is because now the variable UBUNTU_MENUPROXY exists in the environment.21:55
tvstThe obvious solution is to remove it. With pop or whatever you want, but21:55
tvstthat doesn't work! Even if the variable is UNSET, any apps launched by Cardapio still get ignored by AppMenu.21:56
tvstSo I'm thinking that there's a problem with subprocess.popen(),21:56
tvstwhich is what I use to launch apps.21:56
tvstI'm debugging this right now and will get back to you in a couple of minutes.21:56
JanCBorchardttvst: hey Thiago :)21:57
tvsthey!21:57
JanCBorchardttvst, let me know if I can help testing21:57
tvstwill do21:57
Omegatvst: http://bugs.python.org/issue322721:58
OmegaIt says it's fixed in 2.6 though21:59
tvsthmm. let me make a small shell script to test that.21:59
tvstARGH! It seems that bug is NOT fixed!!22:01
OmegaHah.22:01
tvstI made a shellscript with 'printenv > ~/test.txt' in it. Then launched it from Cardapio, and lo and behold, test.txt contains this line UBUNTU_MENUPROXY=libappmenu.so22:02
Omegaand did you try del os.environ['UBUNTU_MENUPROXY']?22:03
tvstyes.22:03
Omegadid that work?22:03
tvstHere's what happens:22:03
tvst>>> os.environ['UBUNTU_MENUPROXY']=''22:06
tvst>>> print os.environ22:06
tvst{..., 'UBUNTU_MENUPROXY':'' , ...}22:06
tvst>>> os.environ.pop('UBUNTU_MENUPROXY')22:06
tvst>>> print os.environ22:06
tvst{...} yay no UBUNTU_MENUPROXY!22:06
tvst>>> subprocess.Popen('test.sh', shell = True, cwd = self.home_folder_path)22:06
tvsttest.sh is simply 'printenv > test.txt'22:06
tvstlook at test.txt and22:06
tvst...22:06
tvstUBUNTU_MENUPROXY=libappmenu.so22:06
tvst...22:06
tvst:(22:06
tvst*wait a second*22:08
Omegadel os.environ['UBUNTU_MENUPROXY']22:08
Omegado that22:08
tvstThe lines above DO work when used in a Python console!22:08
tvstJust not in my script.22:08
tvstThe plot thickens.22:09
tvstOmega: I'll try. But I think I know what's happening...22:09
tvstdel os.environ[ ... ] doesnt work.22:10
tvstlet me try something else.22:10
tvsteh. no go.22:12
XuzzWazzit?22:41
Xuzz...lets check the wiki!22:41
Xuzzlol MeMenu22:42
tvstOmega: ok, I got UBUNTU_MENUPROXY to be *truly* removed from the environment when running subprocess.popen, but launched apps *still* get ignored by AppMenu.22:47
tvstSo now this is looking like an AppMenu bug :-/22:47
Omegatvst: How did you manage to do it?22:49
tvstI just did the os.environ.pop RIGHT BEFORE calling subprocess.popen22:49
tvststrange, huh?22:50
OmegaDoes it work correctly with the shellscript?22:50
tvstyes.22:50
tvstthe result of 'printenv > test.txt' is a file where there's no mention of UBUNTU_MENUPROXY anywhere.22:50
tvst('printenv > test.txt' is what's in the shell script)22:51
OmegaTry it with a test app that uses the appmenu next22:51
tvstI did.22:52
tvstthunar, for example.22:52
tvststill shows the menubar :-/22:52
tvst(I tried thunar because it is *never* running on my system, as opposed to nautilus)22:52
OmegaI mean with an app that does nothing more than use appmenu22:52
tvstlike what?22:53
Omegajust an example app22:53
tvsti don't know what you mean.22:53
OmegaI'll see if I can find one22:53
tvstby the way, i can also launch xterm from Cardapio, and when I run printenv inside of xterm I see the same thing as with the shell script: no mention of UBUNTU_MENUPROXY anywhere.22:53
tvst(message me by name when you find it)22:58
tvstOmega: any luck?23:28
tvstOmega: GOT IT!!23:52
tvstRight before running subprocess.Popen(...) all you have to do is set os.environ['UBUNTU_MENUPROXY'] = 'libappmenu.so'23:53
tvstALL SOLVED!23:53
tvstI'll update the bug report when I confirm that it *really* is solved and that I'm not overlooking something stupid :)23:54
Omegatvst: :D23:54
OmegaAlso, I dced, so I pretty much misssed everything23:54
Omegabefore < tvst> Omega: GOT IT!!23:55
tvstSo I assume AppMenu requires UBUNTU_MENUPROXY to be set to "libappmenu.so" ?23:55
tvst(just trying to understand *why* this works)23:55
Omegaseems so23:55
tvstheh23:55
OmegaHow did you come across it?23:55
tvstJust trying whatever I could think of :)23:56
tvstbut entirely blindly, since I had already seen that...23:57
tvst05:06:22 PM) tvst: UBUNTU_MENUPROXY=libappmenu.so23:57
tvstAnyways, gotta run now.23:57
tvstThanks for pointing me in the right direction23:58
tvstttyl23:58
OmegaCya23:59

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!