/srv/irclogs.ubuntu.com/2011/11/21/#ubuntu-app-devel.txt

=== JackyAlcine is now known as SaintJackyAlcine
=== SaintJackyAlcine is now known as JackyAlcine
hareendrahello there04:08
hareendraany one wo has developed some pannel item (like network manager) to unity04:09
hareendra?04:09
=== EvilJackyAlcine is now known as JackyAlcine
=== popey_ is now known as popey
jmlOK. Wow.10:37
jmlHaving to sneak into a flatmate's room to get internet is not how I like to start the day.10:38
noodles775ouch10:39
mvojml: weeh, that sounds not right :/10:46
jmlthe router is in their bedroom.10:47
jmlshould probably see if we can move it10:47
* mvo nods10:49
jo-erlendI would like to run tests on every save in gedit. So, when I save the file database.py, then it should run trial test_database.py. How do I do that?10:58
jmljo-erlend: I guess there are two things there10:58
jmlone is detecting the save and doing something10:59
jmlthe other is doing the right thing10:59
jmlIf you put an emacs-style variable in database.py like this:10:59
jml# -*- test-case-name: foo.tests.test_database -*-10:59
jmlthen 'trial --test-module=foo.database'11:00
jmlwill run test_database11:00
jmlas for doing something on save, umm, that I don't know.11:00
jmlI mean, you'd probably have to write a program. But it seems like the sort of program that someone must have already written.11:01
noodles775ooh, I remember chatting with james_w about something similar a few years ago (like growl)... and, in typical james_w fashion, he came back the next day with a prototype:11:01
noodles775https://code.launchpad.net/~james-w/+junk/test_watcher11:01
jo-erlendI would like to display a notification bubble on save showing whether the tests pass or not.11:01
noodles775... and here's the mock-demo I did that started our conversation: http://www.youtube.com/watch?v=bvUDYmllVrM11:02
jo-erlendActually, if all tests pass, it should display that bubble and run bzr qcommit.11:03
jmlnoodles775: cool.11:03
jmlnoodles775: I was thinking of a more generic "have files in this dir changed" watcher11:04
jmlnoodles775: but that'll do :)11:04
* noodles775 used to use rspactor years ago, looks like it's turned into https://github.com/guard/guard now.11:07
jo-erlendnoodles775, that looked very similar to what I want.11:11
jmlnoodles775: apparently there's plans to have upstart use inotify to watch directories and trigger jobs.12:21
noodles775Nice12:21
jo-erlendjml, you mean watch all directories?12:26
jmljo-erlend: I meant specific directories, but to be honest I don't know the details.12:26
jmljo-erlend: this is just stuff I picked up from ev from his work on the crash db12:27
xruudI'm going to develop a program on a ubuntu device (prefer it to be headless). The program looks exactly like a photoframe and shows images from the internet. There is no user interaction and the program updates itself. Which develop environment and language would best suit these needs?12:28
xruuddon't answer all at once please :)12:35
xruudfyi, I'm going to try Quickly and MonoDevelop12:36
jml\o/12:54
jo-erlendxruud, Quickly is a very good choice. :)13:05
dpmxruud, let us know how it goes! We recommend quickly (i.e. python and the other tools/technologies it puts together). You can learn how to get started here: http://developer.ubuntu.com/get-started/13:32
dpmOther interesting resources:13:32
dpmhttp://developer.ubuntu.com/resources/tools/quickly/13:33
dpmhttp://developer.ubuntu.com/resources/tutorials/all/diy-media-player-with-pygtk/13:33
jmloh, apparently distribute and pip are supposed to replace setuptools and easy_install13:58
jmlexcept that distribute recommends using easy_install in all its documentation13:59
* jml goes to buy some real eggs from the supermarket13:59
=== johnoxton__ is now known as johnoxton
=== mterry_ is now known as mterry
=== johnoxton__ is now known as johnoxton
noodles775jml: how do I add a requirement in a setup.py based on a bzr branch? (i just tried adding a bzr+http dependency_link in the setup.py but it's an unknown url type.14:45
jmlnoodles775: I'm working on that now. Turns out I might have misinformed you earlier based on a doc that misinformed me.14:45
noodles775Ah, k. I'll upload a tarball instead :/. Thanks!14:46
xruuddpm: I'm trying Quickly first. Curious how it will turn out!14:58
jmlnoodles775: yeah, using the requirements file seems to be it14:59
jmlnoodles775: can you remind me why setup.py is preferred for non-test dependencies?14:59
noodles775jml: I assume so that the package can be installed via the setup.py?15:00
noodles775(at least, that's what I've been using it for)15:00
jmlHmm. I guess that matters if you want to use it as a dependency in another pip/virtualenv/distribute/setuptools/easy_install project15:01
noodles775yeah. I think it was ricardok who started that, and pointed out that there's no reason for them not to be valid python packages (ie. installable themselves)15:01
* noodles775 likes it.15:01
noodles775Interestingly, I just started using it to deploy an app in a juju charm.15:02
jmlI can imagine it's nice when it works, and when you aren't developing dependencies in collaboration or using experimental dependencies15:02
dpmruudt, awesome, let us know how it goes, and feel free to ask any questions!15:09
jmlI'm getting pretty sick of compiling bzr though.15:12
jmlOK. Now when it's running a binary backend script that script cannot import from devportalbinary15:42
jmldespite devportalbinary being installed in the virtualenv and the script using '#!/usr/bin/env python'15:42
noodles775jml: but if the script is being run from a cron, it's not going to know about your virtualenv is it? /me isn't sure of your setup.15:44
jmlnoodles775: it's not being run from cron15:45
jmlnoodles775: the tests, running in a virtualenv, are running some code that runs an executable script which happens to be a Python script15:45
noodles775How is it running the script? popen or something else? (and if it's within the context of a django app, can you use a custom django management command? (easier to test - maybe)15:47
noodles775https://docs.djangoproject.com/en/1.3/howto/custom-management-commands/15:47
jmlah hah15:49
jmlit's using system python15:49
jmlit's using system python15:49
jml(oops)15:49
jmlnoodles775: pkgme itself is launching the script, so we can't use django magic there15:50
jmlnow, why is it using system Python?15:50
noodles775how are you running your script from your test?15:50
jmlAh hah15:51
noodles775achuni: with the ssoclient, what's the equivalent of a the lazr.restfulclient authenticated API?15:51
jmlnoodles775: pkgme uses subprocess.Popen, and the test uses pkgme.15:51
jmlthe issue is that 'fab test' is wrong15:52
noodles775jml: cool15:52
achuninoodles775: the lazr.restfulclient authenticated api as in api.authentications.authenticate()?15:52
jml'virtualenv/bin/python django_project/manage.py test djpkgme' != 'django_project/manage.py test djpkgme' under the virtualenv15:52
noodles775achuni: no, as in ServiceRoot(BasicHttpAuthorizer(username, password), service_root_url)15:53
noodles775jml: why not? does your manage also have the '#!/usr/bin/env python' ?15:54
noodles775oh, I guess it does, or you'd see lots of failures...15:54
jmlyes, it does.15:54
achuninoodles775: that would be SingleSignOnAPI(BasicAuthorizer(username, password), service_root_url)15:54
achuninoodles775: and BasicAuthorizer is from piston_mini_client.auth15:54
noodles775achuni: ah... sweet. I love piston_mini_client.15:55
achuninoodles775: eh, and the args go in the other order15:55
noodles775achuni: yeah, I'll use kwargs anyway.15:55
achunigood idea :)15:55
jmlnoodles775: I'm trying to figure out why not.15:56
noodles775achuni: do you mind if I keep nutting away at this charm if you'll be at the USC call? Or do you prefer me to join too?15:57
* noodles775 joins to be on time anyway :)16:00
achuninoodles775: don't worry, there shouldn't be anything pressing on the call16:01
* noodles775 is already there now.16:02
james_wnoodles775, what's the charm you are working on?16:07
jmlnoodles775: fwiw, the difference is that sourcing 'activate' sets PATH. Just running the python in the virtualenv does not.16:08
james_wyay virtualenv16:10
jmlyeah16:10
jmlI've lost a lot of time to it & its cousins16:10
noodles775james_w: apache-django-wsgi - a general charm for deploying any django app.16:13
jmland yay, cdiff doesn't work in virtualenv because bzr is a dependency16:13
james_wnoodles775, cool, I'd love to take a look16:13
noodles775james_w: yeah, I'll email/post once it's working. Right now I'm trying to remove lazr.restfulclient dependencies from apps.ubuntu.com - the demo app I'm using :/16:14
noodles775jml: isn't your issue that your 'manage.py test djpkgme' is running within the virtualenv, but when you're calling popen, the resulting process isn't? (/me guesses it's inheriting the env, which doesn't include any special PATH, as you said)?16:17
noodles775(and that would make sense, IMO)16:18
noodles775(hrm, other way around, `virtualenv/bin/python manage.py test` is spawning a process which knows nothing about the virtualenv as PATH isn't set)16:24
jmlnoodles775: no, that's not the issue16:26
noodles775ah, k.16:26
jmlnoodles775: what does "within the virtualenv" mean?16:26
jmlit means a certain configuration of environment variables, of which PATH is one16:27
jmlwhich is *not* set just by running virtualenv/bin/python16:27
noodles775jml: That was meant to say "isn't your issue that you 'virtualenv/bin/python manage.py test djpkgme' is running within the virtualenv", in which I meant, running with the virtualenv's python.16:27
* noodles775 doesn't see why it would need to set it - *unless* you were spawning python processes?16:28
jmlso if whatever module is passed to virtualenv/bin/python launches a script that uses '/usr/bin/env python', it's going to get python from the default path16:28
jmlnot whatever path would be set by sourcing virtualenv/bin/activate16:28
jmlnoodles775: yes, I said I was spawning Python processes didn't I?16:29
noodles775yep, I was just trying to figure out what other use cases would require it, but you just ansswered that :)16:29
noodles775So what's the result? If your process will spawn other python processes, make sure the path is set? Yuk. I guess we've never had that issue as our scripts are all django management commands, which we test without needing to spawn a process.16:31
jmlnoodles775: umm... actually, I think the net result is that fab should be within the virtualenv if you want to use fab properly.16:32
james_wagain this seems to come down to the issue that all these tools (virtualenv, eggs, pkg_resources) seem to have been built with an assumption that the whole world is Python16:32
jmlyes16:32
noodles775james_w: I don't really understand what you mean - aiui, virtualenv is only trying to solve a python issue (replicating development environments - python packages - on various OSs?)16:36
noodles775Ah... do you mean like when you try to include PIP in your virtualenv, it tries to compile and fails (or similar). ie. python packages that are wrappers around C++ libraries?16:37
james_wnoodles775, yes, but it works best when you have no other code in your project16:37
james_win this case we want to run scripts in any language that the backend developer wants16:37
james_wif we just supported Python we could use entry points or something16:37
noodles775But you're not using a virtualenv for your actual deploy? (are you?)16:37
james_wno, we're not16:38
james_wbut we have a choice between declaring not to work in virtualenv (or as an egg etc.), or making this work16:38
noodles775And what's not working with virtualenv? (jml's issue above makes sense, and is easily solved I think?). Or on the other hand, do you need to be using a virtualenv at all, or is it just because the dpkgme was setup that way?16:41
jmlnoodles775: there's a hacky way of solving my issue, which is guessing the PATH that virtualenv/bin/activate sets and running 'PATH=$that_guess fab test' (or running fab inside the virtualenv and having to deal with broken/less functional bzr)16:42
james_wnoodles775, there's this which is an extension of something jml was fighting last week, which is that it's really hard to find the paths where python puts data files when dealing with eggs/virtualenv/etc.16:43
noodles775jml: yuk, yes I didn't realise it was that messy.16:44
noodles775jml: is it not just adding virtualenv/lib/python-2.x/site-packages ?16:45
jmlnoodles775: umm, no. it's at least inserting virtualenv/bin to the top of PATH16:46
* noodles775 was thinking of PYTHONPATH, sorry.16:46
jmlnoodles775: so, it's easy to make a good guess, but if virtualenv changes its behaviour then it'll break again.16:47
jmli.e. it's an abstraction violation to have to manually specify PATH16:48
noodles775Sure - I'm just trying to understand why we've never hit this issue, atm I think it's as above, that we've only ever used django commands for our scripts, which we can test within teh same process.16:49
noodles775also, afaik, we never use or depend on activate.16:51
noodles775jml: perhaps a better way would be to pass the current python interpretter to Popen in your test? (ie. the subprocess always runs with the same python environment as the tests themselves)?16:53
noodles775interpreter, even.16:53
jmlnoodles775: if I could rely on all pkgme backends being written in Python, that would work16:54
noodles775jml: isn't this issue only (1) relavent to test in your dev env which is using a virtualenv, and (2) relevant to backends written in Python?16:55
jmlnoodles775: the test isn't directly running the subprocess, it's calling something that calls pkgme, which invokes the backend16:55
noodles775Ah, I see :(16:55
noodles775Hrm, so why is the backend even dependent on the virtualenv? (sorry if I'm going around in circles). Shouldn't it be independent of your development environment?16:56
jmlhow could it not be? this one is written in Python16:58
jmlit needs to import its own Python modules to work16:58
dpmok everyone, calling it a day today, see you tomorrow!16:59
jmlwhere's it going to get them from? Can't get them from the system, because we're in a virtualenv. So it has to be specified as a dependency of djpkgme and it has to get its modules from within the virtualenv17:00
noodles775I didn't realise a backend importing its own python modules would be a problem. I'd thought the backend might not need to import djpkgme stuff, but I guess it does.17:02
noodles775hrm, no, it shoudn't should it? (ie. non-python ones won't be obviously)17:03
jmlit doesn't need to import djpkgme17:04
jmlthis backend (lp:pkgme-binary) has got a fair chunk of code written in Python17:04
james_wjml, I'm on mumble when you want to chat17:04
jmlthat's how it works17:04
jmlI could have written it in Go17:04
noodles775heh17:04
noodles775I'm sure I don't know enough about the setup, I'm just not understanding why the backend - if it's a separate independent process - needs to be in the virtualenv, rather than being a self-contained python package. It'd probably be obvious if I looked at the code instead of asking annoying questions.17:06
noodles775Anyway, dinner time here. Night people.17:06
jmlg'night.17:06
james_wjml, https://github.com/wmorgan/heliotrope17:45
=== baris is now known as Guest13163
Guest13163how can i determine if a package is installed on ubuntu programmatically (c++)? is there a website that explain this?19:10
=== xruud is now known as ruudt
ruudtDeveloping with quickly presents a problem; searching in google for anything like "create fullscreen app quickly" gets misinterpreted. How do you do find answers?21:09
JanCruudt: the default quickly templates use PyGtk = Python + Gtk+, so use PyGtk or maybe Gtk for searching21:47
ruudtJanC: Thanks. I still need to figure out if I need quickly. I will be running it on a headless ubuntu installation. But the program has no user interface but shows images21:48
JanCheadless?21:49
JanChow will you show images then?21:49
ruudtcan't I21:49
ruudtIt actually is a minimal install21:49
JanCwhat do you mean by "headless"?21:49
ruudtno gui21:50
JanCah, most people mean "no display" by "headless", hence my confusion...  ;)21:50
JanCruudt: and by "no GUI", do you mean "no X" or "no desktop environment"?21:51
ruudtno, I had to install 835 packages to get xubuntu-desktop :P21:52
ruudtSo I'd say it is safe to say there is no desktop environment21:53
ruudtThe difference between x or desktop env I do not know (yet)21:53
JanCX is basically the system that puts everything graphical on the screen on linux desktops21:55
ruudtI am quite new and might be ignorant of many parts still. Though I try hard to learn everything21:55
ruudtThe minimal install starts and displays tux while doing so. Would that imply X?21:56
JanCand a desktop environment is a collection of programs (e.g panels, window managers, etc.) that give you a useable desktop experience21:56
JanCnu, that's just using the "framebuffer"21:56
ruudtJanC, I see. I would like the machine to have a minimum of packages installed. It needs wifi and the ability to display images fullscreen21:57
ruudtShould I use quickly?21:57
ruudtThe tutorials seem fixed on making gui programs21:58
JanCyou can display images in this simple framebuffer, but there is not much support for making it easy in that (and generally there is no support for 3D or other GPU acceleration in that framebuffer)21:58
ruudtI don't need that21:58
ruudtI need to display images downloaded from the internet. Nothing more or less21:58
ruudtAlike a picture frame21:59
JanCruudt: I'm pretty sure there are already applications to do that, and you could use a simple script to link them, are you sure that's no solution for your problem?22:00
JanCI mean, applications that show images and applications that can download images22:00
ruudtJanC: that would be fine for my purposes. You suggest I'd find them first. Is there any tactic I should use to find them?22:01
ruudt(Google using specific terms)22:02
JanCto be honest I have alsmost no framebuffer experience, but certainly "framebuffer" is one thing to search for  ;)22:07
ruudtactually really simple suggestion. I found some things on frambuffer. But will discover what I found tomorrow. Sure hope this will be easier then I think it will be. Thanks22:10
JanCone other thing you could do is install an X server (either the default Xorg or an alternative one) and use a simple, single maximized PyGtk app on top of that (you could even use Quickly to create it then, which might help packaging, if that's needed)22:10
ruudtCan I install X on any linux installation if it was not included?22:10
ruudtBecause I'm somewhat limited in Linux options :P22:11
JanCI don't know any well-known desktop linux distro that doesn't have packages for one or more X servers (and certainly not without Xorg)22:12
JanCof course an embeded distro like Android is different22:12
ruudtOk, I'll be fine on that part then22:13
JanChttp://directfb.org/ might be useful too22:14
ruudtIndeed. thanks!22:14
JanCif you don't want to use Xorg22:14
ruudtI'm going to sleep now. I'm almost hitting the keyboard with my head ;)22:15
ruudtBut be sure I'll try your suggestions tomorrow22:15

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