Jack477 / CommanderPi

Easy RaspberryPi4 GUI system managment
MIT License
188 stars 33 forks source link

Two different version in code #30

Closed paulwratt closed 3 years ago

paulwratt commented 3 years ago

in the config.cpi, (when it gets created) there is a version that does not match the app_version which is used to compare when doing an update.

Should they actually be the same. Only app_version is used to compare when updating, ie only color_mode ever get read from the config file.

Both versions should be the same, and it should be read from the config after the config has been created (see PR for config read changes)

NOTE: cpi.config version is a number rs.app_version is a text string (including EOL character)

Along with the other issue (#29) , they should be moved to the separated config_cpi.py. The number version can be injected into the app_version text at startup. This will make it easier when it comes time for multi-language interface changes.

pi@raspberrypi:~/fix-repos/CommanderPi $ grep -nr "app_version" *
src/resources.py:62:app_version = "Version 0.7.2\n" # this version number should come from the config
src/resources.py:63:print("Here is app-1 "+app_version[:-1])
src/resources.py:64:def get_app_version():
src/resources.py:65:    return app_version
src/gui.py:535:     version_label = tk.Label( content_frame, text=rs.get_app_version(), font=("TkDefaultFont", 11, "bold"), justify=CENTER)
src/update.py:29:           if "app_version =" in line:
src/update.py:31:       if rs.app_version[:-1] in xversion:
src/update.py:55:               if "app_version =" in line:
src/update.py:57:           if rs.app_version[:-1] in xversion:
src/update.py:61:           print(rs.app_version)
Jack477 commented 3 years ago

Sure, problem is I've just forget about this version at cpi.config.