Results 1 to 5 of 5

Thread: Help with Python setup.py with multiple folders

  1. #1
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    439

    Default Help with Python setup.py with multiple folders

    Could you please tell me what the setup.py should look like to create a folder structure, for example if I have this:
    Code:
    ../MyProgram
       COPYING
       README
       mainscript.pyw
       /applications
          /app1
             /icons
                pic1.png
             app1.py
          /app2
             /icons
                pic2.png
             /scripts
                script1.py
                script2.py
             app2.py
    etc.
    I read the Python Docs, played with 'package_dir', 'packages' but the OBS still gives me errors it can't find the icon files. I guess the setup script doesn't create them. And when I tried to build an rpm locally, it gave me the same error. When I looked in the BUILD folder, there was no folder 'applications' created and nothing below it.

    Will really appreciate your help. Please provide an example. Thank you.
    Desktop: openSUSE Leap 15 | KDE 5 | Intel i-7500 | Asus ROG STRIX Z270H GAMING | Asus EX-GTX1050TI-O4G nVidia
    Laptop Asus UL30A: openSUSE Leap 15 | KDE 5 | Intel SU7300

  2. #2

    Default Re: Help with Python setup.py with multiple folders

    Hi,

    perhaps you'd better ask this question in the OBS forum, not the programming/scripting one?

    HTH

    Lenwolf

  3. #3
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    439

    Default Re: Help with Python setup.py with multiple folders

    Anyone? I've asked on the OBS forum but no one replied. Please help, my project doesn't build.
    Desktop: openSUSE Leap 15 | KDE 5 | Intel i-7500 | Asus ROG STRIX Z270H GAMING | Asus EX-GTX1050TI-O4G nVidia
    Laptop Asus UL30A: openSUSE Leap 15 | KDE 5 | Intel SU7300

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,320
    Blog Entries
    15

    Default Re: Help with Python setup.py with multiple folders

    Quote Originally Posted by linuxoidoz View Post
    Anyone? I've asked on the OBS forum but no one replied. Please help, my project doesn't build.
    Hi
    The question is where do you want the files to reside in the system, for example for files to reside in /usr/bin (%{_bindir}) you need to define in;
    Code:
    setup(
            scripts          = ['app1','app2']
            )
    The all the rest are in data files, where ever they are in your source structure and where you want them, eg;
    Code:
    data_files       = [
          ('/the/final_file/location', [ 'your/sourcelocation/filename' ] ),
          ('/usr/share/pixmaps/', listfiles( 'images', "*" ) ),
    ]
    the images is a directory, the * is all files and it will install in /usr/share/pixmaps, so normally you would install in /usr/share (%{_datadir}) then would append your app name after the /usr/share
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    439

    Default Re: Help with Python setup.py with multiple folders

    Thank you, malcolmlewis.

    All I want is to install the program start shell script in /usr/bin and this whole exact project structure in /usr/share/MyProgram
    Code:
       COPYING
       README
       mainscript.pyw
       /applications
          /app1
             /icons
                pic1.png
             app1.py
          /app2
             /icons
                pic2.png
             /scripts
                script1.py
                script2.py
             app2.py
    Can I install the whole lot (I mean my whole Python project) as data files and add the shell script? The problem is only file in the main project folder install (e.g. mainscript.pyw) + data files, but none of the other python folders (e.g. /app1/scripts/script1.py) with scripts install.
    Desktop: openSUSE Leap 15 | KDE 5 | Intel i-7500 | Asus ROG STRIX Z270H GAMING | Asus EX-GTX1050TI-O4G nVidia
    Laptop Asus UL30A: openSUSE Leap 15 | KDE 5 | Intel SU7300

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •