ocesou / hooke

Automatically exported from code.google.com/p/hooke
GNU Lesser General Public License v3.0
0 stars 0 forks source link

picoforce file loading error. please help me. #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. when making genlist for my picoforce data
2. hooke shows plot but it is fault
3.

What is the expected output? What do you see instead?
correct plot

What version of the product are you using? On what operating system?
version 0.8.3_devel Seinei on window7 16 bit

Please provide any additional information below.
amantedpaz@gmail.com

please help me.
i'm still learning python language but couldn't find the answer yet.
maybe this is because of my file format.
i'm using nanoscope6.13r

Original issue reported on code.google.com by amanted...@gmail.com on 5 Aug 2010 at 6:42

Attachments:

GoogleCodeExporter commented 8 years ago
I can load your curve successfully with my branch:
  http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
or
  http://code.google.com/p/hooke/source/browse/#svn/branches/wtk
I'm not sure what is broken with the trunk implementation, but I expect it has 
to do with the ordering of the traces.  See the confused hackery in 
PicoForceDriver._replace_name() for my current workaround.
  http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/file/69957c29af81/hooke/driver/picoforce.py#l265

On the downside, I haven't updated the laser-interference correction in my 
branch...

Original comment by tvrkng@gmail.com on 7 Aug 2010 at 1:29

Attachments:

GoogleCodeExporter commented 8 years ago
thank you very much for your comments.
however, i couldn't fix the problem.
i tried to use your picoforce.py but it conflicted with the hooke.py
if you think the origin of this problem comes from the current version of the 
hooke,
could you give me the files you are using?

my e-mail address is amantedpaz@gmail.com.
i really appreciate it.

Original comment by amanted...@gmail.com on 7 Aug 2010 at 12:06

GoogleCodeExporter commented 8 years ago
> i tried to use your picoforce.py but it conflicted with the hooke.py

Yeah, I've been reorganizing Hooke so the internals make more sense to me. See
  http://code.google.com/p/hooke/issues/detail?id=35
and the discussions it references for details.  This is why you can't just drop
my picoforce.py into the old Hooke framework.  The links I gave in my first 
response:
  http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
and
  http://code.google.com/p/hooke/source/browse/#svn/branches/wtk
are both to my restructured Hooke.  You'll have to use the my entire framework, 
or attempt to backport my changes to fit into the old framework.  The easiest 
way to setup my framework would be to unpack one of the bundles from my 
Mercurial branch, e.g.
  http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/archive/tip.tar.gz
or
  http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/archive/tip.zip

The problem with using my branch is that many of the analysis plugins still 
haven't been updated.  If you let me know what you need, I can help, or give 
you suggestions on what to do to get the features you need working.  If 
updating the plugins seems like too much work, you can try backporting my 
playlist plugin to fit into the old framework, but the old framework was pretty 
confusing to me, so I can't help as much there.  A third option would be to try 
and tweak the old playlist plugin to get it to work with your file, see
  http://code.google.com/p/hooke/issues/detail?id=10
for a potentially related problem and some ideas for fixing yours.

Original comment by tvrkng@gmail.com on 7 Aug 2010 at 2:52

GoogleCodeExporter commented 8 years ago
thank you!! 
i unpacked your bundles. it seems very good except i got error message below.
engine.py file is in the folder but i guess it's because it's not installed in 
my computer.

Traceback (most recent call last):
  File "C:\Python26\hooke1\hooke.py", line 67, in <module>
    from . import engine as engine
ValueError: Attempted relative import in non-package

thank you for your help.

Original comment by amanted...@gmail.com on 8 Aug 2010 at 4:52

GoogleCodeExporter commented 8 years ago
That looks like you're running hooke\hooke.py which is a library.  You should 
be running bin\hooke.  See the tutorial:
  http://www.physics.drexel.edu/~wking/rsrch/hooke/tutorial.html
and comments 2 through 5 in issue35
  http://code.google.com/p/hooke/issues/detail?id=35#c2
for more information.

Original comment by tvrkng@gmail.com on 8 Aug 2010 at 8:00

GoogleCodeExporter commented 8 years ago
so sorry for bothering you so long.
i tried to run bin\hooke but it came with longer message. T.T
please check below. was i doing right?

C:\hooke>c:\python26\python bin/hooke
WARNING:root:Could not load LICENSE from hooke.license
Traceback (most recent call last):
  File "bin/hooke", line 3, in <module>
    import hooke.hooke
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 67, in <module>
    from . import engine as engine
  File "c:\python26\lib\site-packages\hooke\engine.py", line 25, in <module>
    from .ui import CloseEngine, CommandMessage
  File "c:\python26\lib\site-packages\hooke\ui\__init__.py", line 25, in <module
>
    from ..license import short_license
ImportError: No module named license

C:\hooke>

Original comment by amanted...@gmail.com on 9 Aug 2010 at 5:14

GoogleCodeExporter commented 8 years ago
Oops, that's my fault.  Should be fixed now in my Mercurial repo as of

  changeset:   550:0677ea4d3c57
  branch:      wtk
  tag:         tip
  user:        W. Trevor King <wking@drexel.edu>
  date:        Mon Aug 09 08:15:19 2010 -0400
  summary:     Allow hooke.ui to load with missing hooke.license submodule.

You should install a new snapshot and try again.

To avoid the annoyance of repeated snapshot installation as I continue to work 
on my branch, I suggest you install Mercurial
  http://mercurial.selenic.com/
and clone my repository.
  hg clone http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/ hooke
Then you can just run
  hg pull --update
to get the new code.

Original comment by tvrkng@gmail.com on 9 Aug 2010 at 12:20

GoogleCodeExporter commented 8 years ago
sorry again. i didn't know this is so difficult to run.
i downloaded mercurial and installed it. then i tried to clone your repository.
as you can see below, after i executed what you taught me it says 'abort: : 
hooke'.
i'm not sure it is cloned or not. However i just went through the next step and 
get error message. what did i do wrong? TT.
and when i tried to run hooke, its error message got longer.....
please help me make this work.

C:\Program Files\Mercurial>hg clone http://www.physics.drexel.edu/~wking/code/hg
/hgwebdir.cgi/hooke/ hooke
abort: : hooke

C:\Program Files\Mercurial>hg pull --update
abort: There is no Mercurial repository here (.hg not found)!

C:\hooke>c:\python26\python bin/hooke
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
WARNING:root:could not import commandline from hooke.ui: No module named readlin
e
I am the Tutorial plugin initialization!
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\python26\lib\multiprocessing\forking.py", line 341, in main
    prepare(preparation_data)
  File "c:\python26\lib\multiprocessing\forking.py", line 450, in prepare
    file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named hooke
Traceback (most recent call last):
  File "bin/hooke", line 5, in <module>
    hooke.hooke.main()
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 210, in main
    hooke = runner.run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 129, in run
    ui_to_command,command_to_ui,command = self._setup_run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 154, in _setup_run
    manager = multiprocessing.Manager()
  File "c:\python26\lib\multiprocessing\__init__.py", line 98, in Manager
    m.start()
  File "c:\python26\lib\multiprocessing\managers.py", line 499, in start
    self._address = reader.recv()
EOFError

Original comment by amanted...@gmail.com on 10 Aug 2010 at 5:31

GoogleCodeExporter commented 8 years ago
> C:\Program Files\Mercurial>hg clone 
http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/ hooke
> abort: : hooke

That line works for me.  Perhaps it was just a flaky network issue and it would 
work if you tried again?  It's strange that it didn't even give you an error 
message, usually there's something like
  abort: HTTP Error 500: ...
Anyhow, add the --verbose and/or --debug options to try to figure out what's 
going on here.

> C:\Program Files\Mercurial>hg pull --update
> abort: There is no Mercurial repository here (.hg not found)!

`pull` needs a repository to update, and since the clone failed, you don't have 
one. 

> C:\hooke>c:\python26\python bin/hooke
> WARNING:root:Could not load LICENSE from hooke.license
> WARNING:root:Could not load short_license from hooke.license
> WARNING:root:could not import commandline from hooke.ui: No module named 
readline

We're getting a bit farther each time ;).  This time I didn't realize readline 
was *nix-only.  I've made it optional now,
  http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/rev/cc891284cb4c
since it just makes the command line more comfortable
  http://docs.python.org/library/cmd.html#cmd.Cmd.cmdloop

Sorry for all the trouble, it's just taking a few iterations to work out the 
kinks with the Unix->Windows and hg->tarball transitions.  We should be closing 
in on a working version though.

Original comment by tvrkng@gmail.com on 10 Aug 2010 at 10:45

GoogleCodeExporter commented 8 years ago
it's alright. thank you for your kindness.
i tried again to clone it but i came with same result.

C:\Program Files\Mercurial>hg clone http://www.physics.drexel.edu/~wking/code/hg
/hgwebdir.cgi/hooke/ hooke
abort: : hooke

C:\Program Files\Mercurial>hg clone http://www.physics.drexel.edu/~wking/code/hg
/hgwebdir.cgi/hooke/hooke
abort: HTTP Error 404: Not Found

i don't know what is wrong..

Original comment by amanted...@gmail.com on 10 Aug 2010 at 11:29

GoogleCodeExporter commented 8 years ago
What is your version of these two commands:
  $ hg --version
  Mercurial Distributed SCM (version 1.4.1)

  Copyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others
  This is free software; see the source for copying conditions. There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  $ hg --verbose --debug clone http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/ hooke
  using http://www.physics.drexel.edu/%7Ewking/code/hg/hgwebdir.cgi/hooke/
  sending between command
  sending heads command
  requesting all changes
  sending capabilities command
  capabilities: stream=65537 branchmap lookup changegroupsubset unbundle=HG10GZ,HG10BZ,HG10UN
  sending changegroupsubset command
  adding changesets
  add changeset 7b24a14509d2
  add changeset c4b0be1f0656
  ...

Original comment by tvrkng@gmail.com on 10 Aug 2010 at 12:36

GoogleCodeExporter commented 8 years ago
my version of Mercurial is 1.6.2. and it didn't work it.
please see below.

C:\Program Files\Mercurial>hg --version
Mercurial Distributed SCM (version 1.6.2)

Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\Program Files\Mercurial>hg --verbose --debug clone http://www.physics.drexel.
edu/~wking/code/hg/hgwebdir.cgi/hooke/ hooke
using http://www.physics.drexel.edu/%7Ewking/code/hg/hgwebdir.cgi/hooke/
sending between command
abort: : hooke

so i removed Mercurial and downloaded same version of Mercurial that you have 
and it worked!! thank you!!
after this command below,
hg --verbose --debug clone 
http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/ hooke

finally it says,
49 files updated, 0 files merged, 0 files removed, 0 files unresolved.

so what should i do now?
should i run "hg pull --update"?
now i'm very cautious because i dont want to ruin this.
thank you for your help again.

Original comment by amanted...@gmail.com on 11 Aug 2010 at 2:19

GoogleCodeExporter commented 8 years ago
Looks like its time to upgrade my mercurial ;).  It's strange that they broke 
backwards compatibility...

> so what should i do now?

The working directory will start out with the default branch
  $ hg branch
  default
But I've been working in the `wtk' branch,
  $ hg branches
  wtk                          518:a008bd5c28ca
  illysam                      367:73fc951770f5 (inactive)
  fft                          284:34cbab99b0a2 (inactive)
  default                      152:98423149f185 (inactive)
Where `inactive' means a branch have been merged into another and no longer 
contains unique commits.  You'll want to update the working directory to my 
branch
  $ hg update wtk
  420 files updated, 0 files merged, 48 files removed, 0 files unresolved
Which should leave your working directory looking something like this:
  $ ls -F
  AUTHORS    conf/     COPYING.LESSER  README    update_copyright.py*
  bin/       contrib/  doc/            setup.py
  CHANGELOG  COPYING   hooke/          test/
At which point you can start running Hooke out of that directory as you were 
with the old tarball directories:
  $ c:\python26\python bin/hooke

> should i run "hg pull --update"?

This command checks the source repository (here, www.physics.drexel.edu/...) 
for new commits, and downloads them to your repository.  The `--update' option 
then updates your working directory to the tip of whatever branch you've 
checked out.  Since you just cloned the repository, it's unlikely that there 
are any useful changes, but by the time you read this, I may have committed 
some ;).  Just run it whenever you find a bug, since I may have fixed it in the 
meantime.  If the bug's still there, let me know and I'll fix it, and then run 
`hg pull --update' to get the fix.

> now i'm very cautious because i dont want to ruin this.

Now that you found the reason for the trouble with the clone command, there's 
really nothing to worry about.  If you really screw something up, you can 
always delete the whole thing and re-clone it. 

> thank you for your help again.

No problem ;).

Original comment by tvrkng@gmail.com on 11 Aug 2010 at 10:32

GoogleCodeExporter commented 8 years ago
it's weird. it actually downloaded files when i cloned yours but it says "there 
is no mercurial repository here." please see below.

C:\Program Files\Mercurial>hg branch
abort: There is no Mercurial repository here (.hg not found)!

C:\Program Files\Mercurial>hg branches
abort: There is no Mercurial repository here (.hg not found)!

so i tried to re-clone it. howevere, it aloso didn't work.
it says "destinatioin 'hooke' is not empty"
where is the destination? i deleted current hooke folder.
what did i do wrong?

C:\Program Files\Mercurial>hg --verbose --debug clone http://www.physics.drexel.
edu/~wking/code/hg/hgwebdir.cgi/hooke/ hooke
using http://www.physics.drexel.edu/%7Ewking/code/hg/hgwebdir.cgi/hooke/
sending between command
abort: destination 'hooke' is not empty

Original comment by amanted...@gmail.com on 12 Aug 2010 at 6:13

GoogleCodeExporter commented 8 years ago
> C:\Program Files\Mercurial>hg branch
> abort: There is no Mercurial repository here (.hg not found)!

  $ hg clone A B
clones the repository at A into a directory B, so
  $ hg clone http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/ hooke
created a new directory
  hooke
under whatever directory you were in when you ran the command.  In your case 
that would be
  C:\Program Files\Mercurial\hooke
You can then move that directory to any place that seems appropriate to you.  
You will want to run Mercurial commands from *inside* that directory, wherever 
it ends up.
  C:\Program Files\Mercurial\hooke> ..\hg branch

> so i tried to re-clone it. howevere, it aloso didn't work.
> it says "destinatioin 'hooke' is not empty"
> where is the destination? i deleted current hooke folder.

I'm not sure which folder you mean by "current hooke folder", but I imagine you 
didn't delete
  C:\Program Files\Mercurial\hooke
and your clone command
  C:\Program Files\Mercurial>hg --verbose --debug clone http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/ hooke
  using http://www.physics.drexel.edu/%7Ewking/code/hg/hgwebdir.cgi/hooke/
  sending between command
  abort: destination 'hooke' is not empty
is letting you know your target directory
  C:\Program Files\Mercurial\hooke
already exists.

To enable you to run Mercurial or Python without specifying their full path, 
you can add their directories to your PATH environment variable
  http://en.wikipedia.org/wiki/Environment_variable
For Windows 7, you can apparently
  http://www.cs.princeton.edu/introcs/15inout/windows-cmd.html
add directories to your PATH via
  Start -> Computer -> System Properties -> Advanced system settings -> Environment Variables -> System variables -> PATH
Adding e.g.
  C:\Program Files\Mercurial\
to your PATH will allow you to run
  C:\Program Files\Mercurial\hg  (or perhaps it is C:\Program Files\Mercurial\hg.exe)
from any directory.  For example,
  C:\Python26\hooke\hg status
  ...

If working via the command line it too awkward on MS Windows.  There are also 
graphical interfaces to Mercurial:
  http://mercurial.selenic.com/wiki/OtherTools#Graphical_User_Interfaces
TortoiseHG
  http://tortoisehg.bitbucket.org/
seems to have good MS Windows support.

Original comment by tvrkng@gmail.com on 12 Aug 2010 at 10:37

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
thanks to your help i could do clone yours and finished what you said on 
comment13.
however, when i tried to run hooke, i got error messages.

C:\hooke>c:\python26\python bin/hooke
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
WARNING:root:could not import commandline from hooke.ui: No module named readlin
e
I am the Tutorial plugin initialization!
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\python26\lib\multiprocessing\forking.py", line 341, in main
    prepare(preparation_data)
  File "c:\python26\lib\multiprocessing\forking.py", line 450, in prepare
    file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named hooke
Traceback (most recent call last):
  File "bin/hooke", line 5, in <module>
    hooke.hooke.main()
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 210, in main
    hooke = runner.run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 129, in run
    ui_to_command,command_to_ui,command = self._setup_run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 154, in _setup_run
    manager = multiprocessing.Manager()
  File "c:\python26\lib\multiprocessing\__init__.py", line 98, in Manager
    m.start()
  File "c:\python26\lib\multiprocessing\managers.py", line 499, in start
    self._address = reader.recv()
EOFError

what is the problem?... T.T
i also updated by using " hg update wtk "

Original comment by amanted...@gmail.com on 12 Aug 2010 at 4:19

GoogleCodeExporter commented 8 years ago
Analyzing your traceback:

> C:\hooke>c:\python26\python bin/hooke
> WARNING:root:Could not load LICENSE from hooke.license

Python found the hooke package successfully.

> Traceback (most recent call last):
>   ...
> ImportError: No module named hooke

But the sub-process fails to find it!

> Traceback (most recent call last):
>   ...
>   File "c:\python26\lib\site-packages\hooke\hooke.py", line 154, in _setup_run
>     manager = multiprocessing.Manager()
> EOFError

And the mother-process dies childless.

Searching the Python issue list
  http://bugs.python.org/
for
  ImportError multiprocessing forking
turned up two bugs, of which
  http://bugs.python.org/issue8534
looks like the culprit (although we don't have an .egg in our case).  I've 
monkeypatched it in my most recent commit.
  changeset:   607:b0ae3d7461a4
  branch:      wtk
  tag:         tip
  user:        W. Trevor King <wking@drexel.edu>
  date:        Thu Aug 12 13:59:26 2010 -0400
  summary:     Add hooke.compat.forking to fix Python's ImportError issue8534.
Update and try again, and let me know how it goes.

Original comment by tvrkng@gmail.com on 12 Aug 2010 at 5:56

GoogleCodeExporter commented 8 years ago
i've updated and tried again but i got the same results.
i feel so sorry for making you stick to this problem so long.
thank you very much.

C:\hooke>hg update wtk
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

C:\hooke>hg pull --update
pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
searching for changes
adding changesets
adding manifests
adding file changes
added 13 changesets with 35 changes to 17 files (+1 heads)
not updating, since new heads added
(run 'hg heads' to see heads, 'hg merge' to merge)

C:\hooke>c:\python26\python bin/hooke
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
WARNING:root:could not import commandline from hooke.ui: No module named readlin
e
I am the Tutorial plugin initialization!
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\python26\lib\multiprocessing\forking.py", line 341, in main
    prepare(preparation_data)
  File "c:\python26\lib\multiprocessing\forking.py", line 450, in prepare
    file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named hooke
Traceback (most recent call last):
  File "bin/hooke", line 5, in <module>
    hooke.hooke.main()
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 210, in main
    hooke = runner.run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 129, in run
    ui_to_command,command_to_ui,command = self._setup_run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 154, in _setup_run
    manager = multiprocessing.Manager()
  File "c:\python26\lib\multiprocessing\__init__.py", line 98, in Manager
    m.start()
  File "c:\python26\lib\multiprocessing\managers.py", line 499, in start
    self._address = reader.recv()
EOFError

Original comment by amanted...@gmail.com on 13 Aug 2010 at 2:10

GoogleCodeExporter commented 8 years ago
> i feel so sorry for making you stick to this problem so long.

No problem.  Thanks for helping me work the kinks out of my branch.

> C:\hooke>hg pull --update
> ...
> not updating, since new heads added
> (run 'hg heads' to see heads, 'hg merge' to merge)

I pushed a new head (probable dead-end work on CommandStacks in XML playlists), 
so you'll have to update by hand:
  $ hg update wtk
Then try it again ;).

Original comment by tvrkng@gmail.com on 13 Aug 2010 at 3:35

GoogleCodeExporter commented 8 years ago
i tried to update wtk after i ran 'hg heads' and 'hg merge' it says 'abort: 
outstanding uncommitted merges'. 
please see below.
since i couldn't update, i got same error when i ran bin/hooke.

C:\hooke>hg pull --update
pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
17 files updated, 0 files merged, 0 files removed, 0 files unresolved

C:\hooke>hg pull --update
pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
searching for changes
no changes found

C:\hooke>hg heads
changeset:   616:390a38b49b45
branch:      wtk
tag:         tip
user:        W. Trevor King <wking@drexel.edu>
date:        Thu Aug 12 22:08:24 2010 -0400
summary:     Use the playlist's basename if it doesn't colide with earlier playl
ists.

changeset:   612:976c46a4376d
branch:      wtk
user:        W. Trevor King <wking@drexel.edu>
date:        Thu Aug 12 16:39:14 2010 -0400
summary:     Initial work on saving CommandStacks in XML playlists

C:\hooke>hg merge
merging hooke/playlist.py
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)

C:\hooke>hg update wtk
abort: outstanding uncommitted merges

Original comment by amanted...@gmail.com on 13 Aug 2010 at 6:53

GoogleCodeExporter commented 8 years ago
What you did:

> C:\hooke>hg pull --update
> pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
> ...
> 17 files updated, 0 files merged, 0 files removed, 0 files unresolved

In your pull from comment 19, you first learned of the new heads, and
  > hg pull --update
didn't want to surprise you by updating without letting you know you had a 
choice about which branch to go down.  With this pull, it figures you know 
about the new heads, so it successfully updates to the tip (note the number of 
updated files).

> C:\hooke>hg pull --update
> pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
> searching for changes
> no changes found

Nothing new has changed at my repository, and you're already at the tip.

> C:\hooke>hg heads
> changeset:   616:390a38b49b45
> branch:      wtk
> tag:         tip
> ...

This is the current tip (note the 'tip' tag).

> changeset:   612:976c46a4376d
> ...

This is the probable dead-end head.

> C:\hooke>hg merge
> merging hooke/playlist.py
> 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
> (branch merge, don't forget to commit)

Now you're merging something.  Reading
  > hg help merge
reading we see you merged your branches other head into your working directory 
and that you must commit (or revert) before further updates are allowed.

> C:\hooke>hg update wtk
> abort: outstanding uncommitted merges

Mercurial is warning you that you haven't committed your previous merge.

What you should have done:
Stopped after the first pull --update, which successfully moved you to the tip. 
 You can always identify your current location with
  $ hg id --num --id --branch --tags
  390a38b49b45 616 wtk tip

How you can recover:
  $ hg status
will list the changed files and give you a feeling for how your working 
directory compares to whatever revision you've checked out.  This will show 
that you've changed hooke/playlist.py.  You can restore the working copy to its 
original checkout state by reverting those changes.
  $ hg revert --all
With a clean working copy, you should run
  $ hg id --num --id --branch --tags
to confirm you are at the tip.  Actually, by the time you get this, you'll 
probably have to run another
  $ hg pull --update
to grab further changes.

> since i couldn't update, i got same error when i ran bin/hooke.

Since you *did* update ;), it means my patch didn't work for some reason.  The 
patch should certainly replace the old
  multiprocessing.forking.prepare
though, so your traceback should be different.  Can you post a full traceback?  
I'll add more logging messages to show when the monkey patches are being 
applied.

Original comment by tvrkng@gmail.com on 13 Aug 2010 at 10:56

GoogleCodeExporter commented 8 years ago
> turned up two bugs, of which
>  http://bugs.python.org/issue8534
> looks like the culprit (although we don't have an .egg in our case).  I've 
monkeypatched it in my most recent commit.

Ah, I just realized that this one *can't* be monkey patched ;).  Here's what 
happens on Linux:
  1) main program starts running
  2) monkey patch applied
  3) multiprocessing.Process() forks off the subprocess.
    a) child process inherits parent's memory, getting all currently imported libraries for free.
    b) child process continues successful run.
  4) main process continues successful run.

While on MS Windows (see
  http://docs.python.org/library/multiprocessing.html#windows
), this happens:
  1) main program starts running
  2) monkey patch applied
  3) multiprocessing.Process() spawns subprocess, feeding its pickling state to the child through the connecting socket.
    a) child process starts, loading (unpatched) base Python libraries to figure out what it should do.
    b) child process starts reading pickled parent state.
    c) child process attempts to find hooke to unpickle parent state.
    d) child process cannot find hooke (with unpatched multiprocessing) and dies.
  4) main process dies from lack of child.

The solution is to apply simonsteiner's issue8534 patch
  http://bugs.python.org/file17092/forking.patch
to your Python's multiprocessing.forking.  This should result in
  1) main program starts running
  2) multiprocessing.Process() spawns subprocess, feeding its pickling state to the child through the connecting socket.
    a) child process starts, loading (patched) base Python libraries to figure out what it should do.
    b) child process starts reading pickled parent state.
    c) child process attempts to find hooke to unpickle parent state.
    d) child process loads hooke.
    e) child process continues successful run.
  3) main process continues successful run.

Original comment by tvrkng@gmail.com on 13 Aug 2010 at 11:25

GoogleCodeExporter commented 8 years ago
thank you for your kindness explanation line by line.

here's what i got. please see below.

also, could you teach me how to apply simonsteiner's isssue8534 patch?
sorry.. i think i'm not following very well.

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\hooke>hg status
M hooke\playlist.py

C:\hooke>hg revert --all
abort: uncommitted merge - please provide a specific revision

C:\hooke>hg head
changeset:   616:390a38b49b45
branch:      wtk
tag:         tip
user:        W. Trevor King <wking@drexel.edu>
date:        Thu Aug 12 22:08:24 2010 -0400
summary:     Use the playlist's basename if it doesn't colide with earlier playl
ists.

changeset:   612:976c46a4376d
branch:      wtk
user:        W. Trevor King <wking@drexel.edu>
date:        Thu Aug 12 16:39:14 2010 -0400
summary:     Initial work on saving CommandStacks in XML playlists

C:\hooke>hg id --num --id --branch --tags
390a38b49b45+976c46a4376d+ 616+612+ wtk tip

Original comment by amanted...@gmail.com on 13 Aug 2010 at 12:37

GoogleCodeExporter commented 8 years ago
> C:\hooke>hg revert --all
> abort: uncommitted merge - please provide a specific revision

Oops, from
  http://mercurial.selenic.com/wiki/Revert
we have
  To undo an uncomitted merge, you can use "hg update -C -r." which will reset the parents to the first parent.
So try that instead.

> also, could you teach me how to apply simonsteiner's isssue8534 patch?

First, find the target file.
  $ python -c 'import multiprocessing.forking as f; print f.__file__'
  /usr/lib/python2.6/multiprocessing/forking.pyc
The path will be different with your Windows install, but it will tell you 
where to go to find forking.py (forking.pyc is compiled bytecode.  You'll want 
to edit forking.py, and forking.pyc will be updated automatically on your next 
Python run).

Once you've found the file, you should apply the patch.  Since Windows doesn't 
have a patch command installed by default, it's probably easiest to open 
forking.py in a text editor (e.g. Notepad) and make the changes by hand.

The diff is in unified diff format (see
   http://en.wikipedia.org/wiki/Diff#Unified_format
).  Broken down line by line:

> --- forking.py    Mon Apr 26 12:53:43 2010
> +++ Copy of forking.py    Mon Apr 26 12:53:00 2010

Patch the forking.py file to become a copy of forking.py.

> @@ -447,17 +447,22 @@

The next block shows the 17 lines after line 447 in forking.py and the 22 lines 
after 447 in the copy.

>                  dirs = [os.path.dirname(main_path)]
>  
>              assert main_name not in sys.modules, main_name

These lines (with no prefix) are present in both versions.

> -            file, path_name, etc = imp.find_module(main_name, dirs)

This line (with the - prefix) is only present in the original version.  Remove 
it when applying the patch.

> +            

This line (with the + prefix) is only present in the final version.  Add it 
when applying the patch.

>              try:

This line (with no prefix) is present in both versions.

And so on...

Basically, you just will be replacing the section:

                dirs = [os.path.dirname(main_path)]

            assert main_name not in sys.modules, main_name
            file, path_name, etc = imp.find_module(main_name, dirs)
            try:
                # We would like to do "imp.load_module('__main__', ...)"
                # here.  However, that would cause 'if __name__ ==
                # "__main__"' clauses to be executed.
                main_module = imp.load_module(
                    '__parents_main__', file, path_name, etc
                    )
            finally:
                if file:
                    file.close()

            sys.modules['__main__'] = main_module
            main_module.__name__ = '__main__'

With:

                dirs = [os.path.dirname(main_path)]

            assert main_name not in sys.modules, main_name

            try:
                main_module = __import__(main_name)
            except ImportError:
                file, path_name, etc = imp.find_module(main_name, dirs)

                try:
                    # We would like to do "imp.load_module('__main__', ...)"
                    # here.  However, that would cause 'if __name__ ==
                    # "__main__"' clauses to be executed.
                    main_module = imp.load_module(
                        '__parents_main__', file, path_name, etc
                        )
                finally:
                    if file:
                        file.close()

            sys.modules['__main__'] = main_module
            main_module.__name__ = '__main__'

Original comment by tvrkng@gmail.com on 13 Aug 2010 at 1:38

GoogleCodeExporter commented 8 years ago
thank you!! i changed forking.py by hands.
but still.... T.T

C:\hooke>hg status
M hooke\playlist.py

C:\hooke>hg heads
changeset:   616:390a38b49b45
branch:      wtk
tag:         tip
user:        W. Trevor King <wking@drexel.edu>
date:        Thu Aug 12 22:08:24 2010 -0400
summary:     Use the playlist's basename if it doesn't colide with earlier playl
ists.

changeset:   612:976c46a4376d
branch:      wtk
user:        W. Trevor King <wking@drexel.edu>
date:        Thu Aug 12 16:39:14 2010 -0400
summary:     Initial work on saving CommandStacks in XML playlists

C:\hooke>hg merge
abort: outstanding uncommitted merges

C:\hooke>hg update -c -r.
abort: uncommitted local changes

C:\hooke>hg id --num --id --branch --tags
390a38b49b45+976c46a4376d+ 616+612+ wtk tip

C:\hooke>hg pull --update
pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
searching for changes
adding changesets
adding manifests
adding file changes
added 6 changesets with 12 changes to 11 files
abort: outstanding uncommitted merges

C:\hooke>c:\python26\python bin/hooke
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
WARNING:root:could not import commandline from hooke.ui: No module named readlin
e
I am the Tutorial plugin initialization!
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\python26\lib\multiprocessing\forking.py", line 341, in main
    prepare(preparation_data)
  File "c:\python26\lib\multiprocessing\forking.py", line 460, in prepare
    file.close()
TypeError: descriptor 'close' of 'file' object needs an argument
Traceback (most recent call last):
  File "bin/hooke", line 5, in <module>
    hooke.hooke.main()
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 210, in main
    hooke = runner.run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 129, in run
    ui_to_command,command_to_ui,command = self._setup_run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 154, in _setup_run
    manager = multiprocessing.Manager()
  File "c:\python26\lib\multiprocessing\__init__.py", line 98, in Manager
    m.start()
  File "c:\python26\lib\multiprocessing\managers.py", line 499, in start
    self._address = reader.recv()
EOFError

C:\hooke>hg update -C -r.
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

C:\hooke>hg id --num --id --branch --tags
390a38b49b45 616 wtk

C:\hooke>hg status

C:\hooke>hg id --num --id --branch --tags
390a38b49b45 616 wtk

C:\hooke>hg pull --update
pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
searching for changes
no changes found

C:\hooke>c:\python26\python bin/hooke
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
WARNING:root:could not import commandline from hooke.ui: No module named readlin
e
I am the Tutorial plugin initialization!
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\python26\lib\multiprocessing\forking.py", line 341, in main
    prepare(preparation_data)
  File "c:\python26\lib\multiprocessing\forking.py", line 460, in prepare
    file.close()
TypeError: descriptor 'close' of 'file' object needs an argument
Traceback (most recent call last):
  File "bin/hooke", line 5, in <module>
    hooke.hooke.main()
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 210, in main
    hooke = runner.run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 129, in run
    ui_to_command,command_to_ui,command = self._setup_run(hooke)
  File "c:\python26\lib\site-packages\hooke\hooke.py", line 154, in _setup_run
    manager = multiprocessing.Manager()
  File "c:\python26\lib\multiprocessing\__init__.py", line 98, in Manager
    m.start()
  File "c:\python26\lib\multiprocessing\managers.py", line 499, in start
    self._address = reader.recv()
EOFError

Original comment by amanted...@gmail.com on 13 Aug 2010 at 5:41

GoogleCodeExporter commented 8 years ago
About your mercurial usage:
* "merge" is for combining branches or heads.  You don't need to use it if 
you're not developing the code.
* don't forget to run "pull" periodically to get updates from my repository.  
"update" changes the revision checked out in your working directory, but it 
doesn't look for changes to the repository itself.
It's probably worth taking a few minutes to read through
  http://mercurial.selenic.com/guide/
to get a better feel for what's going on.

> C:\hooke>c:\python26\python bin/hooke
> ...
> Traceback (most recent call last):
> ...
>   File "c:\python26\lib\multiprocessing\forking.py", line 460, in prepare
>     file.close()
> TypeError: descriptor 'close' of 'file' object needs an argument

Hmm, try adding some debugging printouts in forking.py just before the 
troublesome section:
            assert main_name not in sys.modules, main_name
            print 'PATH', sys.path
            print 'DIRS', dirs
            print 'DATA', data
            print 'CWD', os.getcwd()

so we can get a feel for the situation and maybe guess what's going wrong.

Original comment by tvrkng@gmail.com on 14 Aug 2010 at 3:23

GoogleCodeExporter commented 8 years ago
thank you. i'll read a guide carefully.

here is the information about PATH, DIRS, DATA, CWB.

PATH ['c:\\python26\\lib\\site-packages\\wx-2.8-msw-unicode', 'c:\\python26\\lib
\\site-packages\\wx-2.8-msw-unicode', 'C:\\hooke\\bin', 'C:\\Windows\\system32\\
python26.zip', 'c:\\python26\\DLLs', 'c:\\python26\\lib', 'c:\\python26\\lib\\pl
at-win', 'c:\\python26\\lib\\lib-tk', 'c:\\python26', 'c:\\python26\\lib\\site-p
ackages']
DIRS ['C:\\hooke\\bin']
DATA {'sys_path': ['c:\\python26\\lib\\site-packages\\wx-2.8-msw-unicode', 'c:\\
python26\\lib\\site-packages\\wx-2.8-msw-unicode', 'C:\\hooke\\bin', 'C:\\Window
s\\system32\\python26.zip', 'c:\\python26\\DLLs', 'c:\\python26\\lib', 'c:\\pyth
on26\\lib\\plat-win', 'c:\\python26\\lib\\lib-tk', 'c:\\python26', 'c:\\python26
\\lib\\site-packages'], 'name': 'SyncManager-1', 'log_to_stderr': False, 'sys_ar
gv': ['bin/hooke'], 'authkey': '@\xaa\x0e\xdd\x8d?F\x1b\xdeN\x94Ef"+\x14nlS\x861
\xcf6\xcc\'\x9a?p\x05\xb2\xcf\xf8', 'orig_dir': 'C:\\hooke', 'main_path': 'C:\\h
ooke\\bin\\hooke'}
CWD C:\hooke

Original comment by amanted...@gmail.com on 14 Aug 2010 at 6:00

GoogleCodeExporter commented 8 years ago
I tracked down a windows computer, was able to reproduce the problem, and 
committed a fixed version of Hooke.  Give the new tip a shot.  You can revert 
to the original forking.py if you want, since that ended up not being the 
problem.

Original comment by tvrkng@gmail.com on 14 Aug 2010 at 12:45

GoogleCodeExporter commented 8 years ago
I put more detailed notes from my Windows run up here
  http://code.google.com/p/hooke/issues/detail?id=35#c7

Original comment by tvrkng@gmail.com on 14 Aug 2010 at 1:04

GoogleCodeExporter commented 8 years ago
thank you! i followed the procedure you left on detailed notes.
However, when installing hooke, i got an error message.

error: file 'C:\hooke\bin\hooke' does not exist

i guess this is because you made new file of hooke named hk.

besides, i could run hk.py but i couldn't use 'genlist'. it says it's unknown 
syntax.
please see below.

C:\hooke>c:\python26\python bin/hk.py
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
Hooke version 1.0.0.alpha (Ninken)

All rights reserved.
----
hooke> genlist
*** Unknown syntax: genlist

Original comment by amanted...@gmail.com on 15 Aug 2010 at 8:05

GoogleCodeExporter commented 8 years ago
> error: file 'C:\hooke\bin\hooke' does not exist
>
> i guess this is because you made new file of hooke named hk.

Yup. Thanks.  Fixed.

> hooke> genlist
> *** Unknown syntax: genlist

Yeah.  A lot of the syntax has changed in my version.  See
  http://www.physics.drexel.edu/~wking/rsrch/hooke/
for my documentation.

Original comment by tvrkng@gmail.com on 15 Aug 2010 at 11:13

GoogleCodeExporter commented 8 years ago
> hooke> genlist
> *** Unknown syntax: genlist

See
  http://www.physics.drexel.edu/~wking/rsrch/hooke/tutorial.html#creating-a-playlist
for this particular issue.

Original comment by tvrkng@gmail.com on 15 Aug 2010 at 11:53

GoogleCodeExporter commented 8 years ago
could you tell me why i couldn't make new playlist?
it says there's no such option names '--output_playlist'

hooke> new_playlist --output_playlist mylist
Usage: new_playlist [options]

new_playlist: error: no such option: --output_playlist

Failure

Original comment by amanted...@gmail.com on 15 Aug 2010 at 3:35

GoogleCodeExporter commented 8 years ago
Hmm.  It works for me:
  hooke> new_playlist --output_playlist mylist
  Success

Is this what help tells you?
  hooke> help new_playlist 
  Command: new_playlist

  Arguments:

  help BOOL (bool) Print a help message.
  output_playlist STRING (string) Name of the new playlist (defaults to
      an auto-generated name).
  file FILE (file) Default filename for future saves.

  Create a new playlist.

  ----
  Usage: new_playlist [options]

Original comment by tvrkng@gmail.com on 15 Aug 2010 at 10:14

GoogleCodeExporter commented 8 years ago
would this be a problem? 

C:\hooke>python bin/hk.py
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
Hooke version 1.0.0.alpha (Ninken)

All rights reserved.
----
hooke>

Original comment by amanted...@gmail.com on 16 Aug 2010 at 2:01

GoogleCodeExporter commented 8 years ago
and yes! help tells same thing as you said

hooke> help new_playlist
Command: new_playlist

Arguments:

help BOOL (bool) Print a help message.
name STRING (string) Name of the new playlist (defaults to an auto-
    generated name).
file FILE (file) Default filename for future saves.

Create a new playlist.

----
Usage: new_playlist [options]

Original comment by amanted...@gmail.com on 16 Aug 2010 at 7:28

GoogleCodeExporter commented 8 years ago
> would this be a problem? 
> 
> C:\hooke>python bin/hk.py
> WARNING:root:Could not load LICENSE from hooke.license
> WARNING:root:Could not load short_license from hooke.license
> I am the Tutorial plugin initialization!
> ...

Nope, that just means the licensing information will fall back to the hardcoded 
defaults.  hooke.license contains an auto-generated list of authors, etc.

> and yes! help tells same thing as you said
> 
> hooke> help new_playlist
> Command: new_playlist
> 
> hooke> help new_playlist
> Command: new_playlist
> ...
> name STRING (string) Name of the new playlist (defaults to an auto-
>     generated name).
> ...

No it doesn't ;).  My help called this argument `output_playlist` not `name`.  
You can either use
  hooke> new_playlist --name mylist
or pull my changes and update to a more recent version.

If you have been installing Hooke via setup.py, either be sure to re-install 
the updated version, or (probably easier) uninstall it and just run it from the 
Mercurial directory (adding '.' to your %PYTHONPATH%).

Original comment by tvrkng@gmail.com on 16 Aug 2010 at 10:51

GoogleCodeExporter commented 8 years ago
thank you!
i could sucess by chanig output to name! ^^
thank you so much! :)

in the tutorial, it says it can't interact with plot in CLI. right?
then how do you fitting your force curves?
should i use GUI? how can i run GUI?

Original comment by amanted...@gmail.com on 16 Aug 2010 at 12:10

GoogleCodeExporter commented 8 years ago
The problem with the command line is that you can't see the force curves.  This 
makes it difficult to manually select peaks to be fit to WLCs or to confirm 
that the fits are reasonable.

1) You could `export_block` the block to a data file, plot it in some external 
program, and use the external plot, but that's awkward.
2) You could trust the automatic analysis commands, and run something like:
    bin/hk.py
        -c 'load_playlist test/data/test'
        -c 'zero_surface_contact_point --block retract'
        -c 'flat_filter_peaks --block retract --min_points 1'
        -c 'zero_surface_contact_point --block retract
                --ignore_after_last_peak_info_name "flat filter peaks"'
        -c 'convert_distance_to_force --block retract
                --deflection_column "surface deflection (m)"'
        -c 'remove_cantilever_from_extension --block retract'
        -c 'flat_peaks_to_polymer_peaks --block retract'
        -c 'polymer_fit_peaks --block retract'
        -c 'export_block --block retract --output myblock.dat'
   without looking at any of the intermediate steps.
3) You could run the sequence from (2) in the GUI, and review the results in 
the plot panel, possibly tweaking your analysis before exporting the fit data.  
In that case, you'd want to adjust your .hooke.cfg to run the GUI instead of 
the command line
     http://www.physics.drexel.edu/~wking/rsrch/hooke/gui.html
     http://www.physics.drexel.edu/~wking/rsrch/hooke/config.html
   You would probably also want to add the `--persist` option so the GUI didn't close after running all your `-c ...` commands, or you could skip the `-c` commands when invoking `hk.py` and run them from the GUI interface instead.

For any of these you'll have to upgrade to a new version of Hooke, since I only 
pushed the required fixes to the polymer_fit plugin's commands a few minutes 
ago.

Original comment by tvrkng@gmail.com on 16 Aug 2010 at 4:39

GoogleCodeExporter commented 8 years ago
Note that the sequence in (2) in my previous comment should be entered as a 
single line.  I just wrapped it between commands so it didn't look as 
confusing.  You could also save it in a file (with each command on a single 
line) and run it with.
    $ ./bin/hk.py --script myscript

Original comment by tvrkng@gmail.com on 16 Aug 2010 at 4:43

GoogleCodeExporter commented 8 years ago
thank you for your detail explanation. :)

i tried both second choice and third choice but when i'd like to use GUI, what 
i should do is only changing user interface like this?

[user interfaces]
command line = False
gui = True

when i run bin/hk.py, i saw a picture poped up but i got an error messages 
below.

2010-08-18 16:56:29,846 DEBUG cleanup sending CloseEngine
2010-08-18 16:56:29,848 DEBUG cleanup waiting for Hooke instance from the engine
.
2010-08-18 16:56:29,859 DEBUG cleanup got <class 'hooke.hooke.Hooke'> instance
Traceback (most recent call last):
  File "bin/hk.py", line 7, in <module>
    hooke.hooke.main()
  File "C:\Python26\lib\site-packages\hooke\hooke.py", line 210, in main
    hooke = runner.run(hooke)
  File "C:\Python26\lib\site-packages\hooke\hooke.py", line 131, in run
    hooke.ui.run(hooke.commands, ui_to_command, command_to_ui)
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 1084, in r
un
    app = self._app(commands, ui_to_command_queue, command_to_ui_queue)
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 1080, in _
app
    redirect=redirect)
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 941, in __
init__
    super(HookeApp, self).__init__(*args, **kwargs)
  File "C:\Python26\lib\site-packages\wx\_core.py", line 7978, in __init__
    self._BootstrapApp()
  File "C:\Python26\lib\site-packages\wx\_core.py", line 7552, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 967, in On
Init
    style=wx.DEFAULT_FRAME_STYLE|wx.SUNKEN_BORDER|wx.CLIP_CHILDREN),
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 90, in __i
nit__
    self._setup_panels()
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 202, in _s
etup_panels
    style=wx.WANTS_CHARS|wx.NO_BORDER,
  File "C:\Python26\lib\site-packages\hooke\ui\gui\panel\plot.py", line 123, in
__init__
    self._setup_toolbar(sizer=sizer)  # comment out to remove plot toolbar.
  File "C:\Python26\lib\site-packages\hooke\ui\gui\panel\plot.py", line 159, in
_setup_toolbar
    tw, th = toolbar.GetSizeTuple()
NameError: global name 'toolbar' is not defined

Original comment by amanted...@gmail.com on 18 Aug 2010 at 7:59

GoogleCodeExporter commented 8 years ago
That's what you do.  The traceback is a bug in versions prior to
  changeset:   625:55d13707e107
  branch:      wtk
  user:        W. Trevor King <wking@drexel.edu>
  date:        Sat Aug 14 04:08:04 2010 -0400
  files:       hooke/ui/gui/panel/plot.py
  description:
  Fix toolbar -> self._c['toolbar'] in gui.panel.plot on MS Windows.
Update to a more recent version and try again ;).

Original comment by tvrkng@gmail.com on 18 Aug 2010 at 10:18

GoogleCodeExporter commented 8 years ago
i did tried to update but it says there's no change.
did i do it right? please see below.
also when i see the heads there's no changeset like you mention on comment43.

C:\hooke>hg update wtk
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

C:\hooke>hg pull --update
pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
searching for changes
no changes found

C:\hooke>hg heads
changeset:   660:9c58eb2392b8
branch:      wtk
tag:         tip
user:        W. Trevor King <wking@drexel.edu>
date:        Tue Aug 17 00:02:33 2010 -0400
summary:     Added 'save config'.  Adjusted test/tutorial.py (and test/ in gener
al) passes.

changeset:   612:976c46a4376d
branch:      wtk
user:        W. Trevor King <wking@drexel.edu>
date:        Thu Aug 12 16:39:14 2010 -0400
summary:     Initial work on saving CommandStacks in XML playlists

Original comment by amanted...@gmail.com on 18 Aug 2010 at 11:39

GoogleCodeExporter commented 8 years ago
> did i do it right? please see below.

That looks right, but version since 625:55d13707e107 don't have the toolbar bug 
you mentioned:
  http://code.google.com/p/hooke/issues/detail?id=40#c42

My guess is that at some point you installed Hooke via setup.py, and when Hooke 
loads it's running the installed version, not the one in your Mercurial 
directory.  As I said in
  http://code.google.com/p/hooke/issues/detail?id=40#c38
"If you have been installing Hooke via setup.py, either be sure to re-install 
the updated version, or (probably easier) uninstall it and just run it from the 
Mercurial directory (adding '.' to your %PYTHONPATH%)."

To confirm you can run
  $ python -c "import hooke; print hooke.__file__"
and it will show you the path to the hooke module you are actually using.

> also when i see the heads there's no changeset like you mention on comment43.

That's because it's no longer the head.  Run `hg log` to show all the 
changesets.

Original comment by tvrkng@gmail.com on 18 Aug 2010 at 12:58

GoogleCodeExporter commented 8 years ago
i deleted current "hooke' folder, cloned yours and updated it by using 'clone 
~~' and 'hg update wtk'.

so now the path is corrected.
C:\hooke>python -c "import hooke; print hooke.__file__"
WARNING:root:could not load LICENSE from hooke.license
hooke\__init__.pyc

and i verified that it has the changeset that you mentioned.
C:\hooke>hg log -k "toolbar"
changeset:   625:55d13707e107
branch:      wtk
user:        W. Trevor King <wking@drexel.edu>
date:        Sat Aug 14 04:08:04 2010 -0400
summary:     Fix toolbar -> self._c['toolbar'] in gui.panel.plot on MS Windows.

changeset:   466:f46e3b54a5a5
branch:      wtk
user:        W. Trevor King <wking@drexel.edu>
date:        Sun Aug 01 18:43:07 2010 -0400
summary:     Make gui.panel.plot's toolbar optional & start generalizing axes se
lection

however, when i changed the user interface to GUI.
it comes with this messages. "globar name 'toolbar' is not defined."

C:\hooke>python bin/hk.py
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
WARNING:root:Could not load LICENSE from hooke.license
WARNING:root:Could not load short_license from hooke.license
I am the Tutorial plugin initialization!
2010-08-19 10:26:44,326 DEBUG cleanup sending CloseEngine
2010-08-19 10:26:44,328 DEBUG cleanup waiting for Hooke instance from the engine
.
2010-08-19 10:26:44,338 DEBUG cleanup got <class 'hooke.hooke.Hooke'> instance
Traceback (most recent call last):
  File "bin/hk.py", line 7, in <module>
    hooke.hooke.main()
  File "C:\Python26\lib\site-packages\hooke\hooke.py", line 210, in main
    hooke = runner.run(hooke)
  File "C:\Python26\lib\site-packages\hooke\hooke.py", line 131, in run
    hooke.ui.run(hooke.commands, ui_to_command, command_to_ui)
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 1084, in r
un
    app = self._app(commands, ui_to_command_queue, command_to_ui_queue)
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 1080, in _
app
    redirect=redirect)
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 941, in __
init__
    super(HookeApp, self).__init__(*args, **kwargs)
  File "C:\Python26\lib\site-packages\wx\_core.py", line 7978, in __init__
    self._BootstrapApp()
  File "C:\Python26\lib\site-packages\wx\_core.py", line 7552, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 967, in On
Init
    style=wx.DEFAULT_FRAME_STYLE|wx.SUNKEN_BORDER|wx.CLIP_CHILDREN),
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 90, in __i
nit__
    self._setup_panels()
  File "C:\Python26\lib\site-packages\hooke\ui\gui\__init__.py", line 202, in _s
etup_panels
    style=wx.WANTS_CHARS|wx.NO_BORDER,
  File "C:\Python26\lib\site-packages\hooke\ui\gui\panel\plot.py", line 123, in
__init__
    self._setup_toolbar(sizer=sizer)  # comment out to remove plot toolbar.
  File "C:\Python26\lib\site-packages\hooke\ui\gui\panel\plot.py", line 159, in
_setup_toolbar
    tw, th = toolbar.GetSizeTuple()
NameError: global name 'toolbar' is not defined

just deleting the hooke folder would be a problem?
i don't know how to uninstall it.

also, could you please tell me more detail about runing hooke from the 
Mercurial directory?
i couldn't get what you mean by 'adding '.' to your %PYTHONPATH%'. 
thank you.

Original comment by amanted...@gmail.com on 19 Aug 2010 at 1:35

GoogleCodeExporter commented 8 years ago
>   File "C:\Python26\lib\site-packages\hooke\ui\gui\panel\plot.py", line 159, 
in _setup_toolbar
>     tw, th = toolbar.GetSizeTuple()
> NameError: global name 'toolbar' is not defined

Your file at
  C:\Python26\lib\site-packages\hooke\ui\gui\panel\plot.py
is outdated.  You want be using
  C:\hooke\hooke\ui\gui\panel\plot.py
instead.

> just deleting the hooke folder would be a problem?
> i don't know how to uninstall it.

Yes, you should probably delete everything under
  C:\Python26\lib\site-packages\hooke\
This effectively uninstalls Hooke.  If you want to be sure you got all the 
installed bits, run
  C:\hooke> python setup.py install --record installed-files.txt
To re-install hooke and record a list of installed files.  Then go around and 
delete those files.  See
  C:\hooke> python setup.py --help install
for details (and other useful options).

All "installing" does is copy the hooke module into your Python's default path 
(and potentially stick bin/hk.py somewhere in your %PATH%), so once you've 
removed those copies you've uninstalled Hooke.

> also, could you please tell me more detail about runing hooke from the 
Mercurial directory?
> i couldn't get what you mean by 'adding '.' to your %PYTHONPATH%'. 

Read
  http://docs.python.org/tutorial/modules.html
especially
  http://docs.python.org/tutorial/modules.html#the-module-search-path

Basically, it's only worth installing Hooke if you want to share the 
installation between several users, and then you have to stay on top of 
updating the installed copy as well as your Mercurial repository.

Original comment by tvrkng@gmail.com on 19 Aug 2010 at 1:57

GoogleCodeExporter commented 8 years ago
i deleted all files including 'hooke' folder and every other things recorded on 
installed-files.txt.
then i re-cloned yours and updated.
but now 'python bin/hk.py' got error.
would this because that i didn't setup hooke?

C:\>hg clone http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/ ho
oke
requesting all changes
adding changesets
adding manifests
adding file changes
added 661 changesets with 2374 changes to 771 files (+1 heads)
updating to branch default
49 files updated, 0 files merged, 0 files removed, 0 files unresolved

C:\>cd\hooke

C:\hooke>hg pull --update
pulling from http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/hooke/
searching for changes
no changes found

C:\hooke>hg update wtk
439 files updated, 0 files merged, 48 files removed, 0 files unresolved

C:\hooke>python bin/hk.py
Traceback (most recent call last):
  File "bin/hk.py", line 3, in <module>
    import hooke.hooke
ImportError: No module named hooke.hooke

Original comment by amanted...@gmail.com on 19 Aug 2010 at 6:04

GoogleCodeExporter commented 8 years ago
> C:\hooke>python bin/hk.py
>   ...
> ImportError: No module named hooke.hooke

python can't find hooke because the hooke directory at
  C:\hooke\hooke\
is not in your PYTHONPATH.  You can confirm this with
  C:\hooke> echo %PYTHONPATH%
which I imagine will not print anything.  Since you're running python from
  C:\hooke\
you can add '.' to your PYTHONPATH with
  C:\hooke> set PYTHONPATH=.
At which point python should be able to find your hooke module.

Original comment by tvrkng@gmail.com on 19 Aug 2010 at 10:28

GoogleCodeExporter commented 8 years ago
thanks to your careful and patient help, i could finally load GUI.
thank you so much.

i looked through guide for GUI you told me and tried to get used to it.

upon i'm reading the guide, i found there's something difference between what 
i'm using and the one in the guide.
there's no function key for 'folders'.
it looks like mine is older version, is it?

also, when i'd like to open a force curve file, i first made a playlist like i 
did it in command line interface. then i used 'glob curves to playlist'. 
i selected playlist and typed the file name but it says like this.

Failure
Required argument input not set.

i also tried with full path which is this, "c:\hooke\07241518.001".
but it didn't work, too.
please tell me what i did it wrong.

Original comment by amanted...@gmail.com on 19 Aug 2010 at 4:03

Attachments: