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

Basic .CSV file exporter. #63

Merged
merged 5 commits into from
Jan 21, 2018
Merged

Basic .CSV file exporter. #63

merged 5 commits into from
Jan 21, 2018

Conversation

ShaneKent
Copy link
Owner

@ShaneKent ShaneKent commented Jan 19, 2018

TODO:

  • Possible different file type to export with color, etc.
  • Filtering (once it's complete) will need to effect the export.

Issues:

  • Sorting of the timeline doesn't effect the export.
  • Opening the .CSV file isn't a streamlined process. Possibly export to .XCL or .PDF format instead.

… choose the type of export, the columns to export, and whether or not to use the current project filters in the export.
@ShaneKent
Copy link
Owner Author

Tied to Issue #49

return
print(self.master.current_project)
wizard = ExportWindow(self, self.master.current_project)
wizard.grab_set()

def __enable__(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add the export menu option to the enable and disable of the menu. The feature doesn't work on macs, but it still looks cleaner than a status bar message on Windows.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ah good note. I didn't see that. That's been fixed.

if columns["Event ID"]:
row.append(record.event_id)
if columns["Description"]:
row.append(record.decription)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo: decription -> description.

Additionally, you might want to look into itertools.compress here. You could turn this giant if block into a line or two.


from csv import writer

with open(self.current_project.get_path() + '/{}.csv'.format(self.file_path.get()), 'w') as csvfile:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't the user have some input on where the file is exported to?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I figured no. I believe it makes sense to have the file exported to the project directory - it's at least a good use of the repository. @carterv Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we set that as default but allow them to change locations if they desire?

Copy link
Collaborator

@carterv carterv Jan 21, 2018

Choose a reason for hiding this comment

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

I agree with @zjmonroe23 here. The place where the projects are stored is rather difficult to navigate to. A "..." button to open a directory prompt would be ideal. I'll create a follow-up issue for that.

…porting.

Added export wizard window to enable and disable functions of the menu bar.
@ShaneKent
Copy link
Owner Author

@carterv All comments have been addressed. Still am not allowing the user to choose the output directory of the exported timeline.

Copy link
Collaborator

@zjmonroe23 zjmonroe23 left a comment

Choose a reason for hiding this comment

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

I think assuming the location works for now and we possibly add a custom location feature later if we have time.

…urrent

project directory.

Nice, small changes to improve the look of the wizard.
@ShaneKent
Copy link
Owner Author

@zjmonroe23 @carterv Thanks for accepting. I've added a commit to this request that allows users to change the location of the export. The default location is the current project directory. I will be merging now.

@ShaneKent ShaneKent merged commit ab339a0 into master Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants