X-1.0rc3: Windows: Using folder some-name.sikuli: Save As, saves recursively --- workaround

Bug #891993 reported by RaiMan
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
High
RaiMan

Bug Description

**** Workaround:
Folders where you want to save .sikuli files should not have an extension .sikuli
-----------------------------------------------------------------------------

When trying to save a script using save as in another dir whose extension is .sikuli, the script is saved, but cannot be opened anymore.
When manually looking in the dir, the script was saved, but the myscript.sikuli folder was recursively created.

The tree cannot be deleted anymore with normal means, since the resulting filenames are too long.

Tags: idemenu
RaiMan (raimund-hocke)
description: updated
description: updated
RaiMan (raimund-hocke)
Changed in sikuli:
status: New → Fix Committed
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → x1.0
RaiMan (raimund-hocke)
tags: added: idemenu
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Undecided → High
RaiMan (raimund-hocke)
Changed in sikuli:
status: Fix Committed → In Progress
milestone: x1.0 → x1.1
Revision history for this message
core (crkiii) wrote :

I am having this issue when saving a 'function file'. It's creating recursive directories.

My work around was to move everything to a new folder and only use the IDE for the main. The FN I have in notepad++.

1.1.0-beta1 build 2014-5-5-18
Win7-64 Pro

The full path is c:\users\user\documents\prg\sikuli\SKOne\SKOne.sikuli

C:\Users\user\Documents\PRG\Sikuli>rmdir SKOne /s
SKOne, Are you sure (Y/N)? y
SKOne\SKONE~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.S
IK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK
\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK\SKMAIN~1.SIK - The system c
annot find the path specified.

I'm going to have to do some fancy work for the directory structure repair :P

Revision history for this message
RaiMan (raimund-hocke) wrote :

@core
the last comment was rubbish, so it is hidden now.

Looking at your picture:
You are saving a .sikuli inside a .sikuli folder.
This is exactly the ting to avoid:

SK Main.sikuli
inside of
SKOne.sikuli

BTW: habbits to avoid with file and pathnames:
- no blanks and or special characters besides - (hyphen) and _ (underscore)
- only one . in a filename/path segment, denoting the file ending/type (not: SikuliOne.FN.sikuli but e.g. SikuliOne-FN.sikuli

Revision history for this message
core (crkiii) wrote :

Maybe I read the doc file wrong....

So it should be.....?
project\main.sikuli
project\module1.sikuli
project\module1.sikuli
or...
project\main.sikuli
project\modules\module1.sikuli
project\modules\module2.sikuli

But I think you are saying it is NOT this?
project\main.sikuli
project\main.sikuli\module1.sikuli
project\main.sikuli\module2.sikuli

Also NOT this....?
project\main.sikuli\main.py
project\main.sikuli\module1.py
project\main.sikuli\module1.py

From http://sikulix-2014.readthedocs.org/en/latest/globals.html?highlight=def
Another example: Importing from the same directory

This approach allows to develop a modularized script app that is contained in one directory. This directory can be moved around with no changes and even distributed as a zipped file:

# works on all platforms
import os
# get the directory containing your running .sikuli
myPath = os.path.dirname(getBundlePath())
if not myPath in sys.path: sys.path.append(myPath)

# now you can import every .sikuli in the same directory
import myLib

New in version X1.0-rc3.

Since scripts in same directory are found automatically:

# nothing else needed
# now you can import every .sikuli in the same directory
import myLib

Revision history for this message
RaiMan (raimund-hocke) wrote :

@ core

this is the most convenient:

project\main.sikuli
project\module1.sikuli
project\module2.sikuli

since then you do not even configure sys.path (.sikuli in same directory are found automatically)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.