Is there a way to put externally written python scripts somewhere that
ASE will find them? The ScriptStorageAdapter code talks about "/data/
data/com.google.ase/scripts/" but that's just a locked down internal
path, not an /sdcard reference...
The bit in wiki/UserGuide about using adb to talk to AndroidProxy
remotely is great for writing and testing scripts off-phone (great for
using syntax highlighting editors and version control, after all) but
the step of getting them back on the phone seems to be missing.
(Stuffing them in android/AndroidScriptingEnvironment/res/raw/
python_scripts.zip and rebuilding ASE should work -- is that what we
have for now?)
As you said, scripts are currently stored in
/data/data/com.google.ase/scripts. The plan is to move that to the SD card,
however. Unless you have a rooted phone, the only way to add scripts
externally is to include them in python_scripts.zip. This will change very
soon though since it's pretty painful.
On Tue, Jun 9, 2009 at 6:41 AM, _Mark_ <eic...@gmail.com> wrote:
> Is there a way to put externally written python scripts somewhere that
> ASE will find them? The ScriptStorageAdapter code talks about "/data/
> data/com.google.ase/scripts/" but that's just a locked down internal
> path, not an /sdcard reference...
> The bit in wiki/UserGuide about using adb to talk to AndroidProxy
> remotely is great for writing and testing scripts off-phone (great for
> using syntax highlighting editors and version control, after all) but
> the step of getting them back on the phone seems to be missing.
> (Stuffing them in android/AndroidScriptingEnvironment/res/raw/
> python_scripts.zip and rebuilding ASE should work -- is that what we
> have for now?)
> As you said, scripts are currently stored in
> /data/data/com.google.ase/scripts. The plan is to move that to the SD card,
> however. Unless you have a rooted phone, the only way to add scripts
> externally is to include them in python_scripts.zip. This will change very
> soon though since it's pretty painful.
> On Tue, Jun 9, 2009 at 6:41 AM, _Mark_ <eic...@gmail.com> wrote:
> > Is there a way to put externally written python scripts somewhere that
> > ASE will find them? The ScriptStorageAdapter code talks about "/data/
> > data/com.google.ase/scripts/" but that's just a locked down internal
> > path, not an /sdcard reference...
> > The bit in wiki/UserGuide about using adb to talk to AndroidProxy
> > remotely is great for writing and testing scripts off-phone (great for
> > using syntax highlighting editors and version control, after all) but
> > the step of getting them back on the phone seems to be missing.
> > (Stuffing them in android/AndroidScriptingEnvironment/res/raw/
> > python_scripts.zip and rebuilding ASE should work -- is that what we
> > have for now?)
> Great, thanks (that saves me from digging further into the java
> code :-)
> (Hmm, if I'm going to recompile anyway, adding java.io.File to
> AndroidProxy might be a good shortcut...)
> On Jun 9, 4:07 am, Damon <damonkoh...@gmail.com> wrote:
> > As you said, scripts are currently stored in
> > /data/data/com.google.ase/scripts. The plan is to move that to the SD card,
> > however. Unless you have a rooted phone, the only way to add scripts
> > externally is to include them in python_scripts.zip. This will change very
> > soon though since it's pretty painful.
> > On Tue, Jun 9, 2009 at 6:41 AM, _Mark_ <eic...@gmail.com> wrote:
> > > Is there a way to put externally written python scripts somewhere that
> > > ASE will find them? The ScriptStorageAdapter code talks about "/data/
> > > data/com.google.ase/scripts/" but that's just a locked down internal
> > > path, not an /sdcard reference...
> > > The bit in wiki/UserGuide about using adb to talk to AndroidProxy
> > > remotely is great for writing and testing scripts off-phone (great for
> > > using syntax highlighting editors and version control, after all) but
> > > the step of getting them back on the phone seems to be missing.
> > > (Stuffing them in android/AndroidScriptingEnvironment/res/raw/
> > > python_scripts.zip and rebuilding ASE should work -- is that what we
> > > have for now?)
Hah! I'd gotten just far enough to realize that the interpreter was
running as the same isolated user as the proxy, and had tried some
os.listdir() calls (that failed.) Thanks, that will be useful.
> On Jun 9, 8:58 am, _Mark_ <eic...@gmail.com> wrote:
>> Great, thanks (that saves me from digging further into the java
>> code :-)
>> (Hmm, if I'm going to recompile anyway, adding java.io.File to
>> AndroidProxy might be a good shortcut...)
>> On Jun 9, 4:07 am, Damon <damonkoh...@gmail.com> wrote:
>> > As you said, scripts are currently stored in
>> > /data/data/com.google.ase/scripts. The plan is to move that to the SD card,
>> > however. Unless you have a rooted phone, the only way to add scripts
>> > externally is to include them in python_scripts.zip. This will change very
>> > soon though since it's pretty painful.
>> > On Tue, Jun 9, 2009 at 6:41 AM, _Mark_ <eic...@gmail.com> wrote:
>> > > Is there a way to put externally written python scripts somewhere that
>> > > ASE will find them? The ScriptStorageAdapter code talks about "/data/
>> > > data/com.google.ase/scripts/" but that's just a locked down internal
>> > > path, not an /sdcard reference...
>> > > The bit in wiki/UserGuide about using adb to talk to AndroidProxy
>> > > remotely is great for writing and testing scripts off-phone (great for
>> > > using syntax highlighting editors and version control, after all) but
>> > > the step of getting them back on the phone seems to be missing.
>> > > (Stuffing them in android/AndroidScriptingEnvironment/res/raw/
>> > > python_scripts.zip and rebuilding ASE should work -- is that what we
>> > > have for now?)
I ended up taking it a step further: typed in a bootstrap.py:
import urllib
u = urllib.urlopen("url of a file on one of my sites")
s = u.read()
file('/data/data/com.google.ase/scripts/g1.py', "w").write(s)
(there's a bit more for diags but the above should be all you need)
Then just edit the file on the server, go into ASE and tap bootstrap,
go back to the menu and you'll have a "g1.py", tap that and run it.
Simple way to let me edit with real python tools and without cabling
:-)
On Wed, Jun 10, 2009 at 4:54 PM, Mark Eichin<eic...@gmail.com> wrote:
> Hah! I'd gotten just far enough to realize that the interpreter was
> running as the same isolated user as the proxy, and had tried some
> os.listdir() calls (that failed.) Thanks, that will be useful.
> On Wed, Jun 10, 2009 at 3:13 PM, Tyler Lesmann<redhat...@gmail.com> wrote:
>> You might find this script useful. Imports scripts from ase folder on
>> your SD card to /data/data/com.google.ase/scripts/.
>> On Jun 9, 8:58 am, _Mark_ <eic...@gmail.com> wrote:
>>> Great, thanks (that saves me from digging further into the java
>>> code :-)
>>> (Hmm, if I'm going to recompile anyway, adding java.io.File to
>>> AndroidProxy might be a good shortcut...)
>>> On Jun 9, 4:07 am, Damon <damonkoh...@gmail.com> wrote:
>>> > As you said, scripts are currently stored in
>>> > /data/data/com.google.ase/scripts. The plan is to move that to the SD card,
>>> > however. Unless you have a rooted phone, the only way to add scripts
>>> > externally is to include them in python_scripts.zip. This will change very
>>> > soon though since it's pretty painful.
>>> > On Tue, Jun 9, 2009 at 6:41 AM, _Mark_ <eic...@gmail.com> wrote:
>>> > > Is there a way to put externally written python scripts somewhere that
>>> > > ASE will find them? The ScriptStorageAdapter code talks about "/data/
>>> > > data/com.google.ase/scripts/" but that's just a locked down internal
>>> > > path, not an /sdcard reference...
>>> > > The bit in wiki/UserGuide about using adb to talk to AndroidProxy
>>> > > remotely is great for writing and testing scripts off-phone (great for
>>> > > using syntax highlighting editors and version control, after all) but
>>> > > the step of getting them back on the phone seems to be missing.
>>> > > (Stuffing them in android/AndroidScriptingEnvironment/res/raw/
>>> > > python_scripts.zip and rebuilding ASE should work -- is that what we
>>> > > have for now?)
Brilliant idea! To save space on the phone you could store all your
modules in the cloud and just have scripts that call them down from
your server when you need them.
On Jun 12, 11:16 am, Mark Eichin <eic...@gmail.com> wrote:
> I ended up taking it a step further: typed in a bootstrap.py:
> import urllib
> u = urllib.urlopen("url of a file on one of my sites")
> s = u.read()
> file('/data/data/com.google.ase/scripts/g1.py', "w").write(s)
> (there's a bit more for diags but the above should be all you need)
> Then just edit the file on the server, go into ASE and tap bootstrap,
> go back to the menu and you'll have a "g1.py", tap that and run it.
> Simple way to let me edit with real python tools and without cabling
> :-)
> On Wed, Jun 10, 2009 at 4:54 PM, Mark Eichin<eic...@gmail.com> wrote:
> > Hah! I'd gotten just far enough to realize that the interpreter was
> > running as the same isolated user as the proxy, and had tried some
> > os.listdir() calls (that failed.) Thanks, that will be useful.
> > On Wed, Jun 10, 2009 at 3:13 PM, Tyler Lesmann<redhat...@gmail.com> wrote:
> >> You might find this script useful. Imports scripts from ase folder on
> >> your SD card to /data/data/com.google.ase/scripts/.
> >> On Jun 9, 8:58 am, _Mark_ <eic...@gmail.com> wrote:
> >>> Great, thanks (that saves me from digging further into the java
> >>> code :-)
> >>> (Hmm, if I'm going to recompile anyway, adding java.io.File to
> >>> AndroidProxy might be a good shortcut...)
> >>> On Jun 9, 4:07 am, Damon <damonkoh...@gmail.com> wrote:
> >>> > As you said, scripts are currently stored in
> >>> > /data/data/com.google.ase/scripts. The plan is to move that to the SD card,
> >>> > however. Unless you have a rooted phone, the only way to add scripts
> >>> > externally is to include them in python_scripts.zip. This will change very
> >>> > soon though since it's pretty painful.
> >>> > On Tue, Jun 9, 2009 at 6:41 AM, _Mark_ <eic...@gmail.com> wrote:
> >>> > > Is there a way to put externally written python scripts somewhere that
> >>> > > ASE will find them? The ScriptStorageAdapter code talks about "/data/
> >>> > > data/com.google.ase/scripts/" but that's just a locked down internal
> >>> > > path, not an /sdcard reference...
> >>> > > The bit in wiki/UserGuide about using adb to talk to AndroidProxy
> >>> > > remotely is great for writing and testing scripts off-phone (great for
> >>> > > using syntax highlighting editors and version control, after all) but
> >>> > > the step of getting them back on the phone seems to be missing.
> >>> > > (Stuffing them in android/AndroidScriptingEnvironment/res/raw/
> >>> > > python_scripts.zip and rebuilding ASE should work -- is that what we
> >>> > > have for now?)