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

Added Recent File Menu #209

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

AstroChuck
Copy link
Contributor

OpenMotor now tracks recently opened files and lets you easily return to them.

OpenMotor now tracks recently opened files and lets you easily return to them.
Copy link
Owner

@reilleya reilleya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small things. I'll pull this branch and try it out soon.


def addRecentFile(self, filepath):
recentFilepaths = []
too_long = False
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be unused

def __init__(self, filepath, manager):
super().__init__()
self.manager = manager
tail , self.name = os.path.split(filepath)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: extra space

@@ -24,6 +25,10 @@ def __init__(self, app):
self.fileName = None

self.newFile()

self.recentlyOpenedFiles = []
self.recentFiles = getConfigPath() + 'recentfiles.txt'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a pretty minor difference here, but I'd prefer the use of a yaml file with the same fileIO setup I used for preferences. That is consistent with the rest of the application and gets us things like migrations if we ever need them. You should just be able to stick a list in one of them.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing: concatenating file paths like that isn't always good practice because different operating systems might have different schemes for it. The safest way is with os.path.join. I know I used the + for this in the application myself, but I have learned since then!

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

Successfully merging this pull request may close these issues.

None yet

2 participants