Improve data validation, update records after new posts #60
No reviewers
Labels
No Label
bug
compatibility
documentation
duplicate
enhancement
future release
help wanted
invalid
non-code
question
refactor
testing
this release
wontfix
No Milestone
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cmccabe/linkulator2#60
Loading…
Reference in New Issue
No description provided.
Delete Branch "data-updates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #53
A new function
data.LinkData.add
allows you to add new replies and posts. It writes the record to file, and also to link_data before updating categories (if necessary). This accepts the data.LinkDataRecord class, mainly so it's easy to assign. This means any view items likeprint_categories()
show new data after a record is added.Fixes #3
This uses two regexes to remove characters from a line. This is not very efficient, as there are two passes on the line, so if the regex can be improved that would be cool. There are also some other changes to the loop that reads data in, hopefully to reduce the number of cycles performed on it.
Other
This is fairly big change, and it reverses some previous changes (like
posts_link
is now back inlinkulator
for now). While fixing the issues, I was reading about MVC and so the changes are somewhat based on that idea. Data "model" operations take place in thedata.LinkData
class, "views" are likeprint_categories()
, and "control" in the menu functions. This approach makes sense to me, but let me know if you have different ideas on this.I've includes a small amount of tests, and have been through it a bit myself, but let me know what you think and if you see any issues.