#21 update project information

Unlicense
Ingo
None
2023-06-30
2021-12-28
aliazzz
No
proj = projects.load("D:\Some.library")

project_info = proj.get_project_info()

# Set some values
project_info.company = "Test Library Ltd"
project_info.title = "Script Test Project"
project_info.version = (0, 8, 15, 4711)
project_info.default_namespace = "testlibrary"
project_info.author = "Python von Scriptinger"

# some values recommended in the library toolchain
project_info.values["DefaultNamespace"] = "testlibrary"
project_info.values["Placeholder"] = "testlibrary"
project_info.values["DocFormat"] = "reStructuredText"

# now we set a custom / vendor specific value.
project_info.values["SpecialDeviceId"] = "PLC0815_4711"

# Enable generation of Accessor functions, so the IEC
# application can display the version in an info screen.
project_info.change_accessor_generation(True)

# And set the library to released
project_info.released = False;

proj.save()

Discussion

  • Ingo

    Ingo - 2021-12-28

    Hi Aliazzz,
    thanks a lot! I did myself not know how to customize the project information.

    But what was the future import good for? it doesn't seem to be used anywhere.

     
    • aliazzz

      aliazzz - 2021-12-28

      Just remove the line.

       
  • hermsen

    hermsen - 2021-12-28

    Nice

     

    Last edit: hermsen 2021-12-28
  • aliazzz

    aliazzz - 2021-12-28

    See attached file for result

     

    Last edit: aliazzz 2021-12-28
  • Ingo

    Ingo - 2021-12-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,4 @@
     ~~~
    -from __future__ import print_function
    -
     proj = projects.load("D:\Some.library")
    
     project_info = proj.get_project_info()
    
    • status: Unassessed --> Unlicense
    • assigned_to: i-campbell --> Ingo
     

Log in to post a comment.