Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positions database: migrate to a proper dictionary format via ConfigObj #4

Open
josephsl opened this issue Dec 15, 2017 · 0 comments
Open

Comments

@josephsl
Copy link
Owner

Hi,

Currently, .gc (position listings) files are stored as plain text files. at first glance, this is a good approach as the add-on comes with positions parser. However, in the long run, this format isn't viable.

Thus it is proposed that the positions database be moved to a more dictionary-like interface, preferably via ConfigObj. This means:

  • Familiar key/value pairs structure for each file.
  • If possible, no more string conversions.
  • Familiar ini syntax.
  • No more cursor parsers required, as the dictionary will take care of this.

Costs:

  • Backward compatibility: due to change from text files to a dictionary, backward compatibility is not guaranteed. One way to fix this is to provide a new folder just for 2.0 config and a migration routine. Note that this is still a one-way migration.

Thanks.

josephsl added a commit that referenced this issue Dec 17, 2017
… re #4.

Along with the new positions storage format (identical in structore to an ini file), more code refinements were done. Specifically, the new file format can be opened with ini parsers and dictionary transofmers, inclding ConfigObj (the module used in this add-on).

Plus, more refinements and pythonization work:
* When jumping to a mouse position, str.isdigit is no longer consulted. Instead, a direct integer casting and exception handling will be used, making the code simple.
Due to the new positions format, codecs and opening/reading/writing files directly is no longer supported. A migration tool will be done next.
Due to removal of codecs, in positions list dialog, positions wil be handled via ConfiObj and treated as a dictionary.
The new location for positions database is addonpath/savedPositions. Due to format changes, verion 1 and 2 config are not compatible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant