RSS feed

2008-05-15 Thread Tony Maro
Hey guys n gals - this is request #2 (the first was through the RSS feed TBH
and may have been missed).

Since I migrated my site to a new server and new software a few weeks ago,
the Maemo portion of my RSS feed is no longer available as a separate feed.
The Maemo website has picked up the 403 redirect to my new server and is
feeding all my blog posts and not just the Maemo related stuff like it used
to.

The RSS link is not part of my maemo.org account, so I can't disable it
myself apparently.  If someone would be so kind as to drop the maro.net URL
then the rest of my open source and life related posts will stop showing on
Planet Maemo where they don't really belong.

When I can figure out how to get an RSS feed on just one topic back out of
Drupal, I'll submit a separate RSS link later that will be Maemo only.

Thanks!


-- 
Tony Maro
http://www.ossramblings.com/
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Computerworld article

2007-09-29 Thread Tony Maro
Linked on Slashdot, so likely others have seen this already...

http://www.computerworld.com/action/article.do?command=viewArticleBasicarticleId=9039659


From the article:
--
The Federal Communications Commission *recently
approvedhttp://tinyurl.com/3yhfzb
* a new minitablet, nonphone device from Nokia that supports Bluetooth, WLAN
and GPS. The approval was branded as confidential, so only the sketchiest
of details are available on the product, which will almost certainly ship
this year.

I'm not sure Nokia has the right stuff to compete in the nonphone market.
For starters, the company has trouble focusing on individual products and
tends to scatter its energy and resources across its massive line of
devices. The future king of tiny mobile computers is going to need vision
and focus.

Go ahead and take Nokia off the list of contenders.

--
Personally I think he's got it wrong.  I've noticed with tech companies
(including Microsoft) that third time's the charm.  I think Nokia has
touched into the power users with the open-sourciness (hehe) of Maemo and
gotten enough good feedback that the next revision will be a big hit.
Adding GPS would be awesome if still economical, and if you guys listened to
everyone about sync capabilities for contacts and such, there's no product
that could really compete in my opinion.  Although I think multitouch solid
screens similar to the iPhone might be nice ;-)  At least the solid part.
I'm always afraid I'm going to damage my LCD.  I mean let's be honest - I'd
give up my RAZR in a heartbeat for a good old solid indestructible Nokia
phone that doesn't misdial every time I call someone.  The brand still
carries a lot of weight for me.  And I love my n800.

-- 
Tony Maro
http://www.maro.net/ossramblings.php
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Looks like .maemo.org cert has expired

2007-09-14 Thread Tony Maro
SSL certs on maemo.org expired on the 12th?

-- 
Tony Maro
http://www.maro.net/ossramblings.php
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Python + GTK event question

2007-09-10 Thread Tony Maro
I know this is likely more of a Python + GTK question, but I'm banging my
head against the wall and was hoping someone could help.

I've written a blog post about it as well:
http://www.maro.net/ossramblings.php?itemid=369

It's regarding the GTK kinetic scrolling widget I released last week.

Basically, without getting too deep into the code, here's what I do:

Create a kinetic scrolling widget.  It's a descendant of a DrawingArea.  I
extend that and I allow the new component to hook to some of it's own events
(probably a bad idea, but oh well) so that the new component knows when the
user clicks or drags.  It watches button_press, button_release and
motion_notify events.  When it's realized, it starts a timer for drawing
itself - kind of a framerate timer.

In the button_release_event, I might pass a callback to the application
telling it the user clicked a selection.

In that callback, I destroy the widget and create a new identical widget.  I
then show the new widget, with a new list.

When the widget gets the realize event, it starts an internal timer (which
I remove when the widget is destroyed) using gobject.timeout_add(75,
self.updateme)

I've tested the updateme function and it takes about .04 to .09 seconds to
execute.  Because timeouts don't block other things and don't try to make up
time, I don't get a solid frame rate, but I should get at least .075 seconds
between each event.

Now, when you run the first widget, everything does fine.  I get all the
mousemove events, to the tune of 1 to 15 between each tick.  I set a print
statement in the updateme event so I get a line printed every tick, and you
can watch them fly by.

When you click an item, it triggers the callback in the application that
destroys the widget (which removes the timer just fine).  Then new widget
will then get realized and works almost as expected, except that you can
visibly see that the updateme routine is being called at about half the
speed that it was called the first time, and you only get one pointer motion
event between every tick.  This means that as much as 30 seconds after you
let go of the screen, the app might be getting notified of pointer motion
events still.

Have I gone wrong at some basic level somewhere?  The widget creation is
done identically both times.

Here's the sample code from the application (not the widget):
http://pastebin.org/2151

The only thing I can think of is that it must have something to do with
deleting and creating a new widget from inside the callback of the first
widget.  If I start the process all over again with the same instance of the
app, it's back to normal speed with the first widget, so it's not something
that's hogging CPU.  In fact, top output shows almost no activity during the
slowdown.

-- 
Tony Maro
http://www.maro.net/ossramblings.php
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


I wish you could see what was running before Nokia dies

2007-09-07 Thread Tony Maro
Last night I charged my n800, then did a little web browsing.

As always, I went into offline mode, then locked the screen and placed it
beside the bed.

When I woke up, the battery was stone cold dead.

I wish there were a way to know what might have been running that killed the
battery...

I wonder how hard it would be to write an application that watches processes
for high usage and logs every 5 minutes if something is hogging the CPU.
Maybe have it live as an icon by the battery meter or something...

-- 
Tony Maro
http://www.maro.net/ossramblings.php
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Wiki search outdated?

2007-09-03 Thread Tony Maro
I always forget that the bug tracker tracks the website bugs as well...

On 9/3/07, Quim Gil [EMAIL PROTECTED] wrote:

 Yes, known problem: http://bugs.maemo.org/show_bug.cgi?id=1929

 On Sat, 2007-09-01 at 14:59 -0400, ext Tony Maro wrote:
  I've noticed that you can search for pages that return hits on the
  wiki, but those are old pages that no longer exist and give an error
  when you click the search results.

 --
 Quim Gil - http://maemo.org




-- 
Tony Maro
http://www.maro.net/ossramblings.php
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: OSSO Media Server and system pauses

2007-09-03 Thread Tony Maro
On 9/2/07, Daniel Stone [EMAIL PROTECTED] wrote:

 On Wed, Aug 29, 2007 at 03:35:16PM -0400, ext Jesse Guardiani wrote:
  This is the result of communicating with Tony and Kemal (disq) off list:
https://www.guardiani.us/projects/kagu/changeset/483
 
  Seems to have always been that way. Probably just a typo.

 Amazing what happens when you file coherent, detailed, bug reports,
 instead of just mentioning on an unrelated list somewhere that Kagu is
 complete overengineered crap and should never be used by anyone, mm?


Sigh...
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Wiki search outdated?

2007-09-01 Thread Tony Maro
I've noticed that you can search for pages that return hits on the wiki, but
those are old pages that no longer exist and give an error when you click
the search results.

-- 
Tony Maro
http://www.maro.net/ossramblings.php
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Alpha test of DragonFear for download

2007-08-31 Thread Tony Maro
http://tony.maro.net/ossramblings/dragonfear.php

Definitely an Alpha because you won't get much gaming enjoyment out of it
;-)  I did make a .deb though.

Things you can try out:

Auto-download of media files from the Internet
Kinetic menu navigation
Character Generation
New game creation (it asks for what game to start but won't let you choose
one - don't worry.)
Movement through the map (very small map I hard coded)
Very basic combat, but no spells or magic items to use
View your character's inventory with the fullscreen toggle button
Return to the menu with the Menu button (of all things!)

Things that don't work (yet):

Pretty much everything else.  So don't bother reporting that something
doesn't work as expected.  Definitely report any crashes, though.

This is the fruit of the last two weeks of work.  It's the reason I've been
so concerned with gstreamer, etc.



-- 
Tony Maro
http://www.maro.net/ossramblings.php
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Finding the mmc cards

2007-08-30 Thread Tony Maro
On 8/30/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  I'm interested to hear that anything outside of the SD card has a choice
 in the matter. There was a time when hardware write-protection of this kind
 was exactly that: harware-enforced write-protection. I would have expected
 that, if I put the switch on an SD card into the write-protected position,
 the card itself would disable or ignore write operations (by, for example,
 disabling whatever line/signal is used to perform the write operation).


Nope, the specs leave it up to the device to implement, kind of like the old
notch on floppies ;-)

From the Nokia n800 user manual:

This device does not support the write
protection feature of SD cards.

I don't believe the write protection switch was part of the original MMC
card design specs was it?  I'm not in the loop but it's only recently I
started seeing cards with the switch.  I'm assuming it sets some bit
somewhere to tell the hardware Hey, leave me alone which Maemo promptly
ignores.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Finding the mmc cards

2007-08-29 Thread Tony Maro
On 8/29/07, Marius Vollmer [EMAIL PROTECTED] wrote:


 The internal card is always mounted on /media/mmc2, and the external
 card is always mounted on /media/mmc1.


And when the Nokia n900 (just guessing) gets released, and it has a memory
stick socket or some other type of memory card, I assume we won't be able to
rely on this anymore.  But, sounds like for at least the short term (or long
term in Internet years) relying on mount and /media/mmc* is the way to go.
Assuming you don't need notifications of card insert.

You can also use the environment variables MMC_MOUNTPOINT and
 INTERNAL_MMC_MOUNTPOINT, but then you have to make sure that they are
 always set correctly in your environment.  (I don't think using
 environment variables for this kind of system information is a good
 idea.)


Agreed.  Especially with the numbers of morons like me that are likely to
screw those up ;-)

The device files are not constant like this: the internal card might
 be /dev/mmcblk0 or /dev/mmcblk1, as far as I understand.  Someone with
 better low-level knowledge please correct me.


I had thought this might be the case, especially since my /dev/mmcblk0 goes
to /media/mmc2 and /dev/mmcblk1 goes to /media/mmc1 on my device.  Seemed
kind of reversed to me.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


OSSO Media Server and system pauses

2007-08-29 Thread Tony Maro
Okay, so I ripped out gstreamer and put in OSSO Media Server code.

The thing I've noticed is that there's a distinct pause of about 1 second in
my code when you start a new song playing.  I didn't have this issue with
gstreamer (though the other issues with gstreamer far outweigh the new
problem.)

Without using threads it was nearly a 2.5 second pause, so using a thread
helped.  For a media player app this wouldn't be a problem, but for a game,
it's murder.  I've run cProfile and it says there's only a .02 second delay
in the send_cmd function, but there's a definite pause in user input of
about one second.

I'm going through all this pain because the pygame sound routines can't use
the Maemo sound hardware...
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: OSSO Media Server and system pauses

2007-08-29 Thread Tony Maro
I may have found the issue - in the Kagu code.  Investigating further
still.  I noticed that it was creating a new thread and RPC every time you
start a new song, and things seem to work just fine without doing that...


On 8/29/07, Tony Maro [EMAIL PROTECTED] wrote:

 Okay, so I ripped out gstreamer and put in OSSO Media Server code.

 The thing I've noticed is that there's a distinct pause of about 1 second
 in my code when you start a new song playing.  I didn't have this issue with
 gstreamer (though the other issues with gstreamer far outweigh the new
 problem.)

 Without using threads it was nearly a 2.5 second pause, so using a thread
 helped.  For a media player app this wouldn't be a problem, but for a game,
 it's murder.  I've run cProfile and it says there's only a .02 second delay
 in the send_cmd function, but there's a definite pause in user input of
 about one second.

 I'm going through all this pain because the pygame sound routines can't
 use the Maemo sound hardware...


___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: General Maemo/Scratchbox/N800 help

2007-08-29 Thread Tony Maro
On 8/29/07, David Hazel [EMAIL PROTECTED] wrote:



 It's possible that cards experiencing this problem are not completely
 corrupted beyond repair, but that they've simply had their FAT
 tables damaged to the point where most software can't deal with them. FAT32
 devices seem to have a particular problem, in that if certain elements of
 the FAT table get corrupted, they appear to be completely unusable. This
 kind of damage can be repaired using the Disk Manager on Windows XP or 2000.
 If you use this to reformat such a device, it will come back to life quite
 successfully (but be prepared for a bit of a wait while the Disk Manager
 decides that the device is not properly formatted and that it can't
 therefore show its current format).




I didn't mean to turn this into a discussion of the bug, but from what I've
read there are some apparently very technically capable people who have
tried to low-level format cards after the failure using Windows and they
refuse to be fixed.

Anyway it's just a caution, it hasn't happened to me personally.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Finding the mmc cards

2007-08-29 Thread Tony Maro
On 8/29/07, David Hazel [EMAIL PROTECTED] wrote:


 - whether write protected (yes, you can write-protect an SD card)


Yes, but the Nokia's do not support or honor that switch.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Python and GStreamer

2007-08-29 Thread Tony Maro
On 8/30/07, Austin Che [EMAIL PROTECTED] wrote:


 I've been wondering: what is the performance hit for not going
 through gstreamer? So based on my understanding, going through
 gstreamer, the mp3 is decoded on the DSP. Supposing it was decoded
 on the cpu and sent out through alsa, which of the following is
 likely to be true:



Well I can only say this - my experience now using osso media player instead
of gstreamer is that I can play, pause, start and stop my MP3 media stream
without affecting the frame rate of my game, and if it's not affecting my
frame rate, I'm unconcerned with if it happens in the DSP or not ;-)

Also, Kagu is very good on battery life when using it, so I'm not too
concerned about battery suck with it.

 But obviously I'm no expert - I've only used it for a day.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Python and GStreamer

2007-08-28 Thread Tony Maro
On 8/28/07, Jesse Guardiani [EMAIL PROTECTED] wrote:

 gstreamer is poo. plain and simple. Yes, you need to recreate the
 pipeline. If you don't, bad things happen, like hanging and such after
 EOS. And no, EOS detection still doesn't work well in that class despite
 my many tries. We abandoned gstreamer support in Kagu for a reason. It's
 poo. It's much easier to just use OSSO Media Server via dbus and let
 *it* deal with gstreamer for us.





I'm beginning to realize this about gstreamer as well.  EOS detection seems
to only work about 95% of time, and when it does work you get something like
5 messages thrown at you - so why can't it get just one through on those
5%???

Anyway, can you point me to any docs on using dbus to control OSSO with
Python?  The whole dbus concept is still alien to me.  The only dbus I've
done is the launching with a desktop icon and then using it to get the
screen status (which I copied and pasted from Kagu.)

Wait, I bet the next comment from someone will be Why don't you take a look
at Kagu...  lol.

Okay so I agree gstreamer is out.  Now to get a replacement working...
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Finding the mmc cards

2007-08-28 Thread Tony Maro
After our thread some weeks ago regarding reading the serial number from a
MMC card, I've since implemented detection of the MMC card's presence by the
existence of those same files.  I know my solution works on my device
perfectly.

I figure it's probably a bad decision, because the architecture could change
somewhat with the next hardware or software release.

Can someone tell me, is there an approved / documented way of identifying
the location of any MMC cards currently installed?  I've noticed you can't
simply look for /media/mmcX because that directory will exist even if there
is no card inserted.

Also, what determines MMC1 vs MMC2 as the card's path for
internal/external?  Is it possible these paths would change at some date?  I
know some Linux distro's with SATA drives had a problem with the drives
changing their /dev/sdX path every reboot.  I know that MY Nokia isn't doing
anything similar, but I figure it's possible that my /media/mmc1 might be
internal, but for someone else it could be the external slot - or maybe in
the next hardware revision or something.

I did find the alias names located in the /sys/ path that specify internal
is for one and external or removable or something for the other.  Also,
are the names and paths the same for the 770's?  Since I have an n800 I
don't know.  I'm hesitant to read too much data from /sys/ because it all
looks _so_ Maemo-specific I wonder if I will tie my code too closely to one
hardware revision.

Just looking for the most _compatible_ way to identify if/when and where a
media card is present.

And as usual, from Python.

Thanks,
Tony
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: General Maemo/Scratchbox/N800 help

2007-08-28 Thread Tony Maro
On 8/28/07, Tony Green [EMAIL PROTECTED] wrote:

 On Monday 27 Aug 2007, koos vriezen wrote:

  The usb cable makes the mmc/sd card accessible on your PC, so you
  don't need a card reader.

 Ah, I didn't know that. But then I connect via WiFi rather than USB :-)


I would caution against doing this (though Nokia and maybe several people
here would probably say I'm overreacting.)

Some people seem to have issues that completely corrupt beyond repair a MMC
card and it seems to be possibly tied to using the USB cable to transfer
files to/from your PC and the MMC card in the Nokia.

https://bugs.maemo.org/show_bug.cgi?id=1204

Personally I've only used the USB cable for flashing and I use sftp for
transferring files over the wireless.   It's easier than dealing with cables
anyway.

I do all my developing in Linux, but I just installed WinSCP on my XP
virtual machine and tried it out: http://winscp.net/eng/download.php

It's as powerful as anything I use in Linux, which says a lot when it comes
to SSH / SFTP.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Python and GStreamer

2007-08-27 Thread Tony Maro
On 8/27/07, Leonardo Sobral Cunha [EMAIL PROTECTED] wrote:

 hi tony,

 there is a bug in your code, you dont need to call createGSTPlayer in
 the start method, so you will reuse the pipeline that is already
 created in the constructor (__init__).


Interesting - every implementation I've looked at appears to recreate the
pipeline for every song instead of reusing the old one.  I'll give that a
shot and see what happens.  Let me qualify that statement: The two similar
implementations I've looked at both seemed to do that.

I guess what's most frustrating is it happens randomly, one out of every 20
to 50 executions of the program.  It's not every time.  Kind of makes it
hard to track down specifics.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Python and GStreamer

2007-08-26 Thread Tony Maro
I've been trying to figure out how to use gstreamer to play audio.  It
works, but sometimes it will randomly freeze my application when I try to
start an mp3 file playing.  I'm only using two mp3 files and they both work
at other times (like after a reboot) so I know it's not specifically the
file.

Sometimes I'll start my application which calls the start method of the
SoundControl class below - and no sound starts.  Then, when my app tries to
stop the music, everything freezes up.  It always seems to freeze things
when I call stop

After doing this, my application refuses to work at all (always freezes)
until I reboot my n800.

If anyone has any ideas, I'd greatly appreciate it.  Yes, I know there's
probably more optimized ways to do some of what I have in this class, but
it's grown as I've learned gstreamer, and I haven't stopped to refactor it
yet.

I've gleaned most of this code by looking at ukmp:

class SoundControl(object):
def __init__(self):
print Creating music player
self.createGSTPlayer()

def createGSTPlayer(self):
print Creating player
self.player = gst.parse_launch( gnomevfssrc name=source !
dspmp3sink name=sink ) # id3lib name=id3 !
self.source = self.player.get_by_name( source )
self.sink = self.player.get_by_name( sink )
self.player.set_name(player)
bus = self.player.get_bus()
bus.add_signal_watch()
bus.connect('message', self.on_message)
print Player created

def start(self, filename, newVolume = 80, repeat=-1):
if filename == None: return
self.stop()
time.sleep(0.10)

self.createGSTPlayer()

self.filename = filename
self.repeat = repeat
self.paused = False
if newVolume  0: newVolume = 0
if newVolume  100: newVolume = 100
# self.player.set_property('uri','file://' + filename)
print Setting player location
self.source.set_property(location, filename)
self.sink.set_property('volume',  newVolume*65535/100)
self.player.set_state(gst.STATE_PLAYING)
print Player should be playing

def stop(self):
print stopping player
self.player.set_state(gst.STATE_NULL)

def pause(self, state=None):
print Pause toggle
if state == None:
if self.paused == True:
self.paused = False
self.player.set_state(gst.STATE_PLAYING)
return
self.paused = True
self.player.set_state(gst.STATE_PAUSED)
return
if state == True:
self.player.set_state(gst.STATE_PAUSED)
else:
self.player.set_state(gst.STATE_PLAYING)

def on_message(self, bus, message):
t = message.type
if t == gst.MESSAGE_EOS:
if self.repeat == -1:
print Repeat enabled
time_format = gst.Format(gst.FORMAT_TIME)
self.player.seek_simple(time_format, gst.SEEK_FLAG_FLUSH, 0)
self.player.set_state(gst.STATE_PLAYING)
return
if self.repeat  0:
print Repeat enabled
self.repeat = self.repeat - 1
time_format = gst.Format(gst.FORMAT_TIME)
self.player.seek_simple(time_format, gst.SEEK_FLAG_FLUSH, 0)
self.player.set_state(gst.STATE_PLAYING)
return
print No repeat, stopping
self.player.set_state(gst.STATE_NULL)
elif t == gst.MESSAGE_ERROR:
print Streamer error
self.player.set_state(gst.STATE_NULL)
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


My latest project

2007-08-23 Thread Tony Maro
I got a wild hair and started working on my next GPL release:

http://tony.maro.net/ossramblings/dragonfear.php

It's similar in concept to the original Bard's Tale trilogy.  So far you can
walk around the map (which I've programmatically added rather than saving).
The map can trigger scripts to run when you enter or leave a square and when
you bump into a wall that you can't walk through.

It supports embedding python scripts into the map, item or monster files
that get executed at runtime when appropriate.

I've adapted the kinetic scrolling widget from Kagu to use for user input.
That's just too cool of a widget to pass up ;-)

-Tony
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


python set_device_state_callback

2007-08-23 Thread Tony Maro
I've been trying for hours to get a callback set so I know when the screen
turns off.

I've even tried running the sample code found at:
http://pymaemo.garage.maemo.org/documentation/python_osso_examples/index.html

Nothing I do makes the callback happen.  Does anyone have any better
documentation of how to do this?

Thanks,
Tony
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: python set_device_state_callback

2007-08-23 Thread Tony Maro
Ah, perfect!  I had looked through the Kagu code but completely missed that
tidbit...

Thanks.

On 8/23/07, Kemal Hadimli [EMAIL PROTECTED] wrote:

 You could try using the code from Kagu. ScreenMonitor class from
 maemo.py:
 https://www.guardiani.us/projects/kagu/browser/trunk/src/kagu/maemo.py

 Hope this helps.

 On 8/23/07, Tony Maro [EMAIL PROTECTED] wrote:
  I've been trying for hours to get a callback set so I know when the
 screen
  turns off.
 
  I've even tried running the sample code found at:
 
 http://pymaemo.garage.maemo.org/documentation/python_osso_examples/index.html
 
  Nothing I do makes the callback happen.  Does anyone have any better
  documentation of how to do this?

 --
 Kemal

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


maemo.org scrambled...

2007-08-14 Thread Tony Maro
Looks like large chunks are currently missing (404) or generating script
errors inside Midgard.  I hope someone is in the middle of a revamp or
something...
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


gtk.ToggleButton won't hold state

2007-08-14 Thread Tony Maro
I'v dumped a gtk.togglebutton on a window, but 99% of the time when you
click it, it pops right back up.  Happens with both finger and stylus.

I've connected no events to it, and I'm not programmatically doing anything
to the button.

Is this a feature of the touchscreen, or am I assuming the wrong action
here?
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: gtk.ToggleButton won't hold state

2007-08-14 Thread Tony Maro
Apparently this is a feature of the right side of my touchscreen.  I've
found that if I click the button, it pops up, then I click about a 1/4 inch
below the button it clicks down and stays down.  Clicking below the button
the first time does nothing.



On 8/14/07, Tony Maro [EMAIL PROTECTED] wrote:

 I'v dumped a gtk.togglebutton on a window, but 99% of the time when you
 click it, it pops right back up.  Happens with both finger and stylus.

 I've connected no events to it, and I'm not programmatically doing
 anything to the button.

 Is this a feature of the touchscreen, or am I assuming the wrong action
 here?

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: gtk.ToggleButton won't hold state

2007-08-14 Thread Tony Maro


 On 8/14/07, Tony Maro [EMAIL PROTECTED] wrote:
 
  I'v dumped a gtk.togglebutton on a window, but 99% of the time when you
  click it, it pops right back up.  Happens with both finger and stylus.
 
  I've connected no events to it, and I'm not programmatically doing
  anything to the button.
 
  Is this a feature of the touchscreen, or am I assuming the wrong
  action here?
 



I just had one of those Oh crap, I should have kept my mouth shut
moments.  It's the theme.  It _looks_ untoggled because it still has focus -
looking closer shows the text in the button shifted down and left.  Once it
loses focus, it draws in a dark color.

Ugh.  Move along, there's nothing to see here.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: maemo.org scrambled...

2007-08-14 Thread Tony Maro
Still seeing errors on several pages, for instance:

http://maemo.org/development/documentation/how-tos/

*Notice*: Trying to get property of non-object in
*/usr/share/midgard/svn/midcom/trunk/src/midcom.core/midcom/helper/_styleloader.php(532)
: eval()'d code* on line *31

*
On 8/14/07, Henri Bergius [EMAIL PROTECTED] wrote:

 On 8/14/07, Tony Maro [EMAIL PROTECTED] wrote:
  Looks like large chunks are currently missing (404) or generating script
  errors inside Midgard.  I hope someone is in the middle of a revamp or
  something...

 The server was upgraded from EOLd PHP4 to PHP 5.2, which caused some
 issues for a while.

 Things are good now, next we need to invalidate Squid caches.


 --
 Henri Bergius
 Motorcycle Adventures and Free Software
 http://bergie.iki.fi/

 Skype: henribergius
 Jabber: [EMAIL PROTECTED]
 Jaiku: http://bergie.jaiku.com/

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Controlling virtual keyboard from Python application?

2007-08-13 Thread Tony Maro
On 8/13/07, Mohammad Anwari [EMAIL PROTECTED] wrote:

 Pada hari Senin, tanggal 13/08/2007 pukul 10:50 -0400, ext Igor Tkach
 menulis:
  Does anybody know if there's a way to interact with the virtual
  keyboard from a Python (Pymaemo) app, i.e. programmatically bring it
  up or hide it? What about finger keyboard?

 There is no easy way to do that, but you probably could try to emulate
 the triggers (e.g. the stylus or finger tap on the text entry), so the
 Hildon Input Method wakes up and invoke the input method based on the
 trigger.



I would propose that this is a bad idea.  I use a Bluetooth keyboard about
40% of the time, and Maemo is very good about NOT popping up the keyboard
when my BT keyboard is active.

That said, I have noticed that something in gre-calendar interferes with the
pop-up keyboard.  You can get the smaller keyboard but not the finger
keyboard when entering a new event.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


How to keep window on top? (python)

2007-08-13 Thread Tony Maro
I'm a noob at both Python and GTK so forgive me if this is a silly question.

I've got a modal window I'm creating, and I've tried doing
set_transient_for but no matter what I've done, it won't stay on top of
the base application window.  You can easily pick the app window from the
taskbar and switch to it, even though it can't get input.

If a user does this by accident, it leaves the impression that the program
has locked up.

Can someone point me in the right direction?  Or does busybox not support
this?
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: How to keep window on top? (python)

2007-08-13 Thread Tony Maro
On 8/13/07, Pierre Amadio [EMAIL PROTECTED] wrote:

 Hi there.

 On Mon, Aug 13, 2007 at 11:46:38AM -0400, Tony Maro wrote:
  I've got a modal window I'm creating, and I've tried doing
  set_transient_for but no matter what I've done, it won't stay on top
 of
  the base application window.  You can easily pick the app window from
 the
  taskbar and switch to it, even though it can't get input.

 I use something like:

 self.prefWindow=hildon.Window()
 self.prefWindow.set_title(Preferences)
 self.prefWindow.set_modal(True)
 self.prefWindow.set_transient_for(self.mainWindow)
 self.prefWindow.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)

 Hopes it helps :)



Exactly what I needed.  Thanks!
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


dbus and startup script

2007-08-13 Thread Tony Maro
I just took a hint from the Kagu project and moved all my Python scripts
into /usr/lib/thummim

I made a shell script to launch the main Python script.

Now, when launching, the Thummim Reader - Loading box takes forever to go
away.  Everything else works fine.

Have I taken the wrong approach?  It's not killing the application like it
was before I added osso.Context handling, but obviously it's not processing
the hey I'm here and working message quite like I would expect.

My shell script looks like this:

#!/bin/sh
cd /usr/lib/thummim
python ./Thummim


The Thummim python script sets the osso.Context when it starts.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: dbus and startup script

2007-08-13 Thread Tony Maro
I've got all of that in place as well.  It didn't start doing this until I
wedged the shell script in front of the startup of the Python.

I took out the shell script, replaced it with the main python script, and at
the top of the main python script I placed:

import sys
sys.path.append('/usr/lib/thummim/')

That way it could find it's include files stored in the other directory.
Everything works fine again, including the dbus integration and taskbar
icon.

On 8/13/07, Kemal Hadimli [EMAIL PROTECTED] wrote:

 Hey, glad somebody is peeking on our code :)



That's the Best way to learn!  What I want to do is learn how to do kinetic
scrolling without needing full screen mode.  Not a priority, but that's
something I hope to learn from your app soon.  Neat stuff.


The loading indicator should go away when you create the HildonProgram
 and HildonWindow (see /usr/lib/kagu/kagu-scanner.py) but if it's not
 working, check the dbus service file as missing it could be (I'm not
 sure, don't really remember) also relevant.


 On 8/13/07, Tony Maro [EMAIL PROTECTED] wrote:
  I just took a hint from the Kagu project and moved all my Python scripts
  into /usr/lib/thummim
 
  I made a shell script to launch the main Python script.
 
  Now, when launching, the Thummim Reader - Loading box takes forever to
 go
  away.  Everything else works fine.
 
  Have I taken the wrong approach?  It's not killing the application like
 it
  was before I added osso.Context handling, but obviously it's not
 processing
  the hey I'm here and working message quite like I would expect.
 
  My shell script looks like this:
 
  #!/bin/sh
  cd /usr/lib/thummim
  python ./Thummim
 
 
  The Thummim python script sets the osso.Context when it starts.


 --
 Kemal

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Obtaining flash memory serial numbers on Nokia N800

2007-08-12 Thread Tony Maro
On 8/12/07, David Hazel [EMAIL PROTECTED] wrote:

  OK, so far I haven't had a reply that really answers my original
 questions, so let me rephrase them:


I'd tend to disagree, but let's go on ;-)

1. Given a full directory path, how can I determine FROM WITHIN AN
 APPLICATION which storage device (memory card) this corresponds with? In
 other words, starting with something of the form /dir1/dir2/dir3/file, how
 can I identify the storage device that this resides on?


Well, that one would best be determined by reading the output of df or mount
I would think.  Because the Linux file system is so flexible, there may not
be an actual device associated with a given path.  Some of the paths in
the file system are actually output from running applications.  Others might
be mounted across the network using any number of network file systems.  For
instance, the /proc directory doesn't really exist on a Linux hard drive so
much as is output by a program running on the machine.  So when you say you
want to find which storage device a path corresponds with there may not be
an answer because the question is wrong.  Read on for more info...

2. Having found the above, how can I then find that storage device's serial
 number? (Again, FROM WITHIN AN APPLICATION)


Um, actually that was the answer everyone provided.  No need to yell -
that's generally what gets most Linux advocates bristling and starts flame
wars.

Just read the text file at the specified location.  Where we said cat
XX, cat was just meaning dump the contents of that file to the console,
so you could just open that file like any text file and read the serial
number out of it.  That's Linux 101, but certainly is alien to anyone who
has done Palm, PocketPC or Windows development.

So in Python for instance, you might do:

mypath = '/sys/devices/platform/mmci-omap.1/mmc1*/cid'
srcfile = open(mypath,'r')
myserial = srcfile.readline()
srcfile.close()
# tada! no need for any include's either.  Nice and simple.

You can use the same method to find the type of processor in the device, how
much memory card space is in use, and untold many other tidbits of cool
information.  Keep in mind, Linux aka Unix was originally designed around
everything communicating to each other through what is basically console
I/O.  It's a really neat system when you think about it.  This means there's
no special API that needs written or header files that must be available for
each language in order to access this information.  Other aspects of the
Linux OS are actually changed just simply by writing to these fake text
files in your directory structure.  These fake text files are just the
communications medium between applications.  And that's a Fact. ;-)

Fact: I can programmatically determine an SD card's serial number on a
 Windows Mobile device. Therefore I expect this to be possible on the Nokia
 800 as well.


Sure, just read it from the file system as described above.  Linux provides
the /sys/devices (or on a desktop normally /proc/whatever) file system to
make it easier to do this, so there's not even an API you need.  Just read
the settings you're looking for from the OS supplied text file.

Fact: I can programmatically map a directory path onto its corresponding
 device under Mac OS X (which is BSD Unix with go-faster stripes). Therefore
 I expect to be able to do something similar on an N800 running a variant of
 Linux (which is Unix-like, right?).


If you're talking about mounting sure, but you'll need to do it as root
for security reasons.  If that's not what you mean, you'll need to clarify.

Someone who's a C programmer might be able to expound on my comments and
give other options as well.

Also, on a side note, you sent your response directly to me and not the
list, so I'm submitting it back to the list as well assuming it was an
oversight on your part.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Obtaining flash memory serial numbers on Nokia N800

2007-08-11 Thread Tony Maro
On 8/11/07, Frantisek Dufka [EMAIL PROTECTED] wrote:

 David Hazel wrote:
  On Fri, 2007-08-10 at 22:52 +0300, Igor Stoppa wrote:
  I don't know about MMC/SD (isn't that something that is not public
  available?)
 
  I would hope that the serial number of an SD card can be read on the
  Nokia. It can certainly be read from an SD card that is installed on a
  Windows Mobile device.

 cat /sys/devices/platform/mmci-omap.1/*/cid

 * is there because the path contains card model name which is variable.
 In my case for Transcend 150x 4GB SD the name is 'b368' and card is in
 internal slot


I have other things in that directory, so it appears a better path is...

for the internal:
cat /sys/devices/platform/mmci-omap.1/mmc0*/cid

for the external
cat /sys/devices/platform/mmci-omap.1/mmc1*/cid

I also found that:
cat /sys/class/mmc_host/mmc0/slot_name
will tell you the name of the card (internal or external)

Good info, by the way.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Do I really need ScratchBox?

2007-08-11 Thread Tony Maro
I just want to make a package of a Python application I wrote.

Do I really need scratchbox?  It seems overkill to install all that
cross-compile stuff when everything I write is in Python and doesn't need
compiled.

If not, is there a tutorial for making a Python app into a .deb package?
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Finally, my first project

2007-08-11 Thread Tony Maro
I just released the first beta of Thummim Reader:

http://tony.maro.net/ossramblings/thummim.php

It's a scripture reader that will read any text file, and also supports an
index file that points to verse locations.  You can highlight text in any
color, add notes that click through to verses, and add bookmarks that link
to any of your documents.

It's very easy to make your own index files, and I also have a utility for
your desktop computer that will download the King James Bible and other
documents from lds.org.

I don't distribute any documents so I can't inadvertently violate a
copyright.

I couldn't have done it without the help here!

Thanks,
Tony
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Obtaining flash memory serial numbers on Nokia N800

2007-08-10 Thread Tony Maro
On 8/10/07, David Hazel [EMAIL PROTECTED] wrote:

 On Fri, 2007-08-10 at 22:52 +0300, Igor Stoppa wrote:
  I don't know about MMC/SD (isn't that something that is not public
  available?)

 I would hope that the serial number of an SD card can be read on the
 Nokia. It can certainly be read from an SD card that is installed on a
 Windows Mobile device.



This is very useful if you're just trying to tell one card from another.
For instance, if you're storing a database on a specific card, have your
application recognize when that card is in your device verses the card from
your camera, or another card with a similar database.

Normally you would get this from /proc/scsi/ or similar, but there doesn't
appear to be any entries for it...
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Make file open browse root tree?

2007-08-09 Thread Tony Maro
On 8/6/07, Austin Che [EMAIL PROTECTED] wrote:


  Is there a way to make the file open dialog browse the entire tree,
 either
  by specifying something in sourcecode, or a secret trick to get the
 existing
  dialog to show everything?

 Something like this works for me:
 cd MyDocs; ln -s / root


I've learned that this is a BAD thing to do - sends the metalayer-crawler
into an endless loop and sucks your battery dry.

That explains why I've had issues since doing this with both responsiveness
and battery life...
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Python startup desktop icon

2007-08-09 Thread Tony Maro
I'm trying to follow the instructions at
http://maemo.org/development/documentation/how-tos/3-x/python_maemo_3.x_howto.html

I have the icon launching my app just fine, but when I use the
X-Osso-Service and a .service dbus file, I get something odd.

It tells me Starting app in the top right, and the application starts just
fine.

Then, after about 20 seconds, the app closes.  If I launch it without using
X-Osso-service, it of course gives no notification that the app is opening,
but it opens and stays open.


Here's my thummim.desktop file:

[Desktop Entry]
Encoding=UTF-8
Name=Thummim Reader
Comment=Thummim Scripture Reader
Exec=/home/user/Thummim/Thummim
Type=Application
Icon=gpe-todo
X-Osso-Service=thummim
X-Osso-Type=application/x-executable

Here's my thummim.service file:

[D-BUS Service]
Name=com.nokia.thummim
Exec=/home/user/Thummim/Thummim
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Python startup desktop icon

2007-08-09 Thread Tony Maro
On 8/9/07, Eduardo Lima [EMAIL PROTECTED] wrote:

 Hi,

 You need to call osso.Context() somewhere in your code, preferably in
 the beginning of main function. You'll also need to call osso.close()
 in the end of your code.



Aha!  Exactly what I needed.  Thanks!
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Loving the development

2007-08-04 Thread Tony Maro
In the past four days since I got my n800 I'm thrilled with it.

I started programming in python two days ago (I'm a Pascal  PHP guy,) and I
just finished my first working program - er if you can call it finished.
It's a Bible reader that allows you to highlight sections of text.  it also
allows you to jump to books, chapters and verses with just a few clicks.  It
stores the text in plain text rather than compressed, and uses two secondary
files for storing your markups and the pre-supplied index file that points
to the start of each verse.

It will also open standard text files with no index file and still allow you
to add highlightings.

I took the completely open and oversimplified road with the file formats
because I was so frustrated at looking at the file formats used by all the
other palm readers, not to mention trying to figure out the sword file
format.  Other than the fact that loading the indexes for the Old Testament
file takes about 5 seconds, it's very fast and uses very little running
memory.

I designed it to only read in the page of text you're currently reading from
the large text file, so you don't have to load the entire text into memory.

Next I've got to add some file management features (currently you file+open
the document you want) and some note taking features so you can create your
own topics that link to specific areas of the files.

Probably late next week I'll release it for download.  I'm running it from
xterm right now, so it's still not ready for prime time ;-)
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


ColorSelectionDialog in Python

2007-08-03 Thread Tony Maro
I can't for the life of me figure out how to use the ColorChooserDialog in
Python.

I try to call it the same way I do hildon.FileChooserDialog, but when I use
hildon.ColorChooserDialog all I get is:
'module' object has no attribute 'ColorChooserDialog'

Yes, my file includes hildon.

I also can't find any examples other than the main API entry for it.  Any
suggestions?
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers