An additional package manager for managing Microsoft apps on Linux distros.
Parse bottle files and constructure a package class which can be used in transactions. Set of valid packages keys is defined. func@_parse_bottle_file: - Module protected function called internally to parse bottle files. - Extract the Description field (this is a little different from other fields given it can be multiline). - Remove any comments which may have been left by a user. - Process the bottle file and extract all key-value pairs. This will also ensure that mandatory fields exist, and that any fields which are repeated are flagged (parser will cause app to crash). - Return a dictionary of key-value pairs. class@_Soybottle: - Class (struct) which represents a bottle file in a structured format. The dictionary is unwrapped after parsing and populates this class using the `.loadPackage()` classmethod. - Defined repr dunder which will return a string representation of the class as a dictionary (note class uses slots). - method@loadPackage(): - Defines a set of mandatory fields required in the bottle file. - Reports and exits if mandatory fields are missing. Warn if unrecognised fields exist. - Separate optional fields from mandatory ones. - Construct new class instance and return the object. class@PackageItem: - Class which stores information regarding a package, including whether it is installed, and the package information from _Soybottle. Class is early development. func@loadPackage: - This function is akin to _Soybottle@loadPackage, but *should* be called instead of the classmethod. To be called when a bottle file is given as argv, not by bottle file in the database. - Given a filename (`item=`), will attempt to open and read the contents of a bottle file. If the file is readable, it will then begin parsing and constructing a new class@PackageItem object. - Function will attempt to permanently store a bottle file to database. If this fails, the app will sys-exit. - Either the class@PackageItem or Exception is returned. This is to allow for exception messages to be given back to the install command. |
||
|---|---|---|
| assets | ||
| soypak | ||
| .gitignore | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| spec.bottle | ||