On Thursday 17 of September 2015 14:27:33 David Cortesi wrote:
> Refer to https://github.com/pyinstaller/pyinstaller/issues/1460 for context.
> 
> The Analysis() call in a spec file now allows passing
>    datas=[list of tuples of data files]
> and
>    binaries=[list of tuples of binaries]
> This is a big improvement over the old method where the user had to use TOC
> or TREE to encode such files.
> 
> Reading the comments in the code, I see there are some rough edges and
> TODOs in this support as yet.
> 
> I need to document this feature in the manual section on "Using Spec
> Files", however, it is important to document only what you WANT the users
> to know about -- not everything that the code allows, and certainly nothing
> that might change in future.
> 
> So please comment on these points.
> 
> datas= and binaries= are both lists of two-tuples. In each tuple, the first
> item is a string that names the files to be copied:
> 
> * if it is a name or relative path, it is taken as relative to... what? the
> path to the main script?

Recently I implemented that relative path to the main script is relative to 
the .spec file (option --specpath which defaults to current directory)

Not sure how it is now but I think to be consistent it should be relative to 
.sped file too.

> 
> * it can name a single file, or it can be a "glob" that names multiple files
> 
> The second item in the tuple names the destination for the files at
> execution time.
> 
> * This must be a relative path.

correct

> 
> * It is relative to the location of the executable program at run-time (the
> one folder or the MEIPASS temp folder).

correct
 
> ? Does glob work the same in Windows and Unix? Or are the rules different?
> (n.b. the glob module doc just says "rules used by the Unix shell")

Yes, it does. I just tested it. You can use backslashes or forward slashes. 
Statements like this works:

c:\\Users\\*\\*
c:/Windows/System32/*

> ? How does the user specify "same place as the executable"? Comments in the
> code say the target dir shouldn't be None or empty -- may it be "."?

Yes, it may be "."  I think I tried using that recently in a hook and it 
worked :-)

> 
> ? What happens if the target dir string starts with separator char "\" or
> "/"?

undefined

Do you mean '\' written in python code as '\\'?

Some thoughts:
- behavior probably defined from os.path.join()
- windows: '/' and '\' are both considered as separators it should be fine
- unix: '/' considered as root and thus absolute path.
- there would be difference in onefile/onedir mode:
  - onedir: files might be copied somewhere else and gets not included with the 
app
  - onefile: files would be bundled but during execution probably not extracted 
into tmp dir but somewhere else.

There should be implemented error checking

> 
> ? What if the target dir string starts with ".." ?

undefined

previous thoughts applied here too.

There should be implemented error checking

> ? Please can you suggest a realistic example for binaries=? Preferably one
> relevant in Windows?

I will try to put something together.

> 
> Cheers,
> DC

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to