Hi Justin,
Sorry for the late reply.
It works like a charm, thanks!
On Thursday, February 16, 2017 at 8:04:50 PM UTC-8, Justin Israel wrote:
>
> Untested, but that looks to be almost exactly the same logic as what I
> gave you for tracking the counts for each user/product. But instead of
> tracking a counter you would just accumlate the size:
>
> user_ver_count = defaultdict(lambda: defaultdict(int))
> user_ver_size = defaultdict(lambda: defaultdict(int))
>
> ...for vers_name, artist_alias in gen_dict.iteritems():
> ...
> user_ver_count[artist_alias[0]][strip_version_name] += 1
> user_ver_size[artist_alias[0]][strip_version_name] += artist_alias[1]
>
>
>
> Also, this line is impossible to read:
>
> users = ', '.join('{0} [{1} ({2}]'.format(alias,
> convert_size_query(sum(int(i) for i in asset_size_dict.get(alias))),
> user_ver_count[alias][version_name]) for alias in
> asset_user_dict[version_name])
>
>
>
> It doesn't hurt to break up your logic into individual lines, to help others
> that can and will end up reading your code. And also to set obscure members
> of a list into a nicely named local variable :-)
>
> Justin
>
>
>
> On Fri, Feb 17, 2017 at 1:50 PM likage <[email protected] <javascript:>>
> wrote:
>
>> This time round, I tried using tuple like you have mentioned. see,s to be
>> working well but I got an issue, where if there is an existing user, it
>> will collate and summed up the overall data size under 1 user...
>>
>> In the pastebin, I am expecting item_C to be `kilo [3 (1]` but it seems
>> to add up the values derived from item_B in kilo's case
>>
>> http://pastebin.com/raw/qBxxaszK
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/705d5dd5-8be5-4449-8149-2f5a9af7b77e%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/python_inside_maya/705d5dd5-8be5-4449-8149-2f5a9af7b77e%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/ccd99399-493e-4616-8c2f-a5ba656e172b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.