Projects with __init__.py files

Asked by Jonathan Kossick

When I build the package of my programm the most __init__.py Files are missing. I think they were not moved.
What can I do to fix this problem?

Question information

Language:
English Edit question
Status:
Solved
For:
Quickly Edit question
Assignee:
No assignee Edit question
Solved by:
Jonathan Kossick
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Tony Byrne (tony-badwolf) said :
#1

Hi Jonathan

When I do this
$quickly create ubuntu-application initok
$cd initok
$ls -R |grep __init__
__init__.py
__init__.py

I see 2 entries for __init__.py
which are
initok/__init__.py and initok_lib/__init__.py

then
$quickly package
$ cd ..
and I look in initok_0.1_all.deb with file-roller
$ file-roller initok_0.1_all.deb
i can see /usr/share/pyshared/initok/__init__.py and /usr/share/pyshared/initok_lib/__init.py
which is exactly what I expected
Can you give more details of your problem

Revision history for this message
Jonathan Kossick (j-kossick) said :
#2

I fixed the problem but I don't really know the reason for the problem, because I had only to copy the __init__.py from another folder in this folder. The new file has contrary to the old __init__py an icon in nautilus.

I also found the "data_files=[" option which is very useful but is there also an option to insert a whole folder?

Thanks for the help!

Revision history for this message
Tony Byrne (tony-badwolf) said :
#3

Hi Jonathan

Have a look at
import glob

data_files=[('/destination', glob.glob('source_folder/*'))]

glob,glob will create a list of all the files in the source_folder.

Revision history for this message
Jonathan Kossick (j-kossick) said :
#4

Thank you!! Problem solved!

Revision history for this message
Jonathan Kossick (j-kossick) said :
#5

One last question: Is there a possibillity do give permissions to the files you insert with the data_folder[ option? The file is in the pyshared/my_project/directory.

Revision history for this message
Jonathan Kossick (j-kossick) said :
#6

I changed the path of the files to the home directory, so I dont have this problem anymore.