shotgunsoftware / tk-multi-importcut

Import Cut app
Other
0 stars 0 forks source link

36093 code cleanup #44

Closed sgsteph closed 8 years ago

sgsteph commented 8 years ago

Lot of changes in there, goals were:

A couple of bugs were fixed and some UI improvements were added.

Some things could still be better, but let's check if we reached a good first step.

Please note that commits from Jun 23 and later were never reviewed so extra care must be taken for them.

raphaelmatto commented 8 years ago

Finished looking at the code. Besides code stuff, I noticed the following issues when interacting with the app:

kporangehat commented 8 years ago

Need to update the README.md

kporangehat commented 8 years ago

tk-multi-importcut/app.py

We use lambda like that in lot of places, so I think this is one these PEP8 rules that we don't follow

I think this should be left for later, when we will revisit the Premiere integration

Agree with your comments, but, again I think this should be left for later, when we will revisit the Premiere integration. Chances to break it are high

kporangehat commented 8 years ago

python/tk-multi-importcut/edl_cut.py

These are all comments on code not specifically part of the PR. Sorry, it's a fair amount of stuff with varying degrees of importance. Some of this is potential group discussion but any disagreements with my own opinions just let me know. I could very well be wrong! 👼

General

My suggestions are written (usually) to match the existing code style but if any of the below style comments change for consistency then of course my suggestion should follow the same format.

Code Review

kporangehat commented 8 years ago

tk-multi-importcut/python/cut_diff.py

General

Some general comments that apply to this as a whole:

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/dialog.py

General

Some general comments that apply to this as a whole:

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/cut_summary.py

General

Some general comments that apply to this as a whole:

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/cut_diff_widget.py

General

Some general comments that apply to this as a whole:

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/entity_line_widget.py

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/search_widget.py

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/constants.py

Code review:

# Different steps in the wizard process
kporangehat commented 8 years ago

tk-multi-importcut/python/create_entity_dialog.py

Code review:

    entities page. A user can enter an entity name with a description. On submit
    the entity is created and the stacked widget moves to the next page.
kporangehat commented 8 years ago

tk-multi-importcut/python/cut_diffs_view.py

General

Some general comments that apply to this as a whole:

Code review:

        Called when the user clicks on the top view selectors in the Cut summary
kporangehat commented 8 years ago

tk-multi-importcut/python/cuts_view.py

Code review:

        Display only Cuts whose name matches the given text.

        Display all of them if text is empty.
        Called when a cut card is selected.

        Ensure only one is selected at a time.
        for sort in _SORT_METHODS:
kporangehat commented 8 years ago

tk-multi-importcut/python/downloader.py

Code review:

        :param sg_attachment: Either a URL or an Attachment dictionary
                # todo: test this code. But how do we create a situation
                # where the thumbnail (is it always a thumbnail?) ia an
                # Attachment and not a string path to an aws bucket?

A local install / VM won't ship to AWS. Though I think by default this will give you a local Shotgun url.

kporangehat commented 8 years ago

tk-multi-importcut/python/extended_thumbnail.py

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/logger.py

Code review:

    The short_name strips the two first parts of the logger path, allowing
    us to not print the <uuid>.<app name> part in logs.
            # Special case for tk-shotgun and tk-desktop:
            # - tk-shotgun : messages are displayed in a pop up window after
            #                the app is closed, which is confusing
            # - tk-desktop : messages are sent through a pipe to the desktop server
            #                and are logged in the tk-desktop log. We have our own
            #                logging file and sometimes tk-desktop will hang when
            #                writing data, so don't log anything
kporangehat commented 8 years ago

tk-multi-importcut/python/processor.py

General

Some general comments that apply to this as a whole:

Code review:

        Return the current Shotgun Project we are importing the Cut into.

        This can be None if this app was started outside of a Project
        context, and a Project has not been selected yet.
        Return the name of the Entity that the Cut is linked to, if any
_Actually, this is the target for the Cut import, so this docstring would be slightly wrong_
        Return the display name of Entity's type that the Cut is linked to, if any
_Actually, this is the target for the Cut import, so this docstring would be slightly wrong_
        Return the current Shotgun Cut we are displaying Cut changes for

        :returns: A Cut dictionary or None
kporangehat commented 8 years ago

tk-multi-importcut/python/settings_dialog.py

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/user_settings.py

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/widgets/animated_stacked_widget.py

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/python/widgets/drop_area.py

Code review:

kporangehat commented 8 years ago

tk-multi-importcut/info.yml

Code review:

kporangehat commented 8 years ago

Summary

Despite the massive amount of notes, this feels really well done. The polish here will put it in very good shape IMO.

General Style Notes

There were some general style-related issues that came up that weren't necessarily addressed individually at every occurrence. Ideally these should be addressed app-wide. The main goal at this point is consistency. Whether indents are done one way or another (as long as it's reasonable and readable), isn't as important as being consistent throughout the app.

That said, there are also some discussions to have about various indenting situations, inline comments, variable naming, level of nitpicking we want to do for these, etc. Those will be left to the larger group discussions (but let's have them!).

Other Thoughts

That's it. Code review complete! 🎉

sgsteph commented 8 years ago

Went through all comments. Didn't address some of them as some further changes are pending on other branches and I didn't want to cause un-necessary conflicts. Some answers:

kporangehat commented 8 years ago

Okay I'm good for this to 🚢. I responded to some items in bold above. Thanks for all of the answers and extensive review.

Though a lot of this was smaller stuff, and the code was pretty clear to start, I think this is a huge improvement. Good to merge!