[10:06:07] hello I am back to work. [10:06:27] Soon I will update the library functions. [14:04:33] hello zhuyifei [14:04:47] hi [14:05:23] Is this fine to conevrt the very long line to multi-line using '\'? [14:05:50] *convert [14:06:11] which one? [14:06:34] https://github.com/infobliss/sibutest2/blob/master/libraries/gen_lib.py#L31 [14:06:57] a sec, I'll rewrite this one [14:09:45] Do add you as contributor to the repo? [14:10:16] *Do I add [14:10:51] uh, idk [14:14:16] https://www.irccloud.com/pastebin/RY1lPvbx/ [14:14:29] ^ this would be about how I would write it [14:14:39] see if it works as expected [14:15:51] although using the old style substitution (eg. %(creator)s) may prevent the need of ".replace('{{', '{{{{').replace('}}', '}}}}')" so I might prefer that [14:16:50] ok [14:17:31] basically, don't abuse '{}{}{}'.format(a,b,c) [14:17:42] alright. [14:18:01] even that would be better written as ''.join([a,b,c]) [14:18:43] I thought both are same. [14:18:52] but yeah it looks compact [14:19:05] but if a lot of it are constants, consider 'a' + b + 'c' or 'a%sc' % b or 'a{}c'.format(b) [14:19:30] well, you need keep track of how many {} to use [14:20:04] which is extra maintenance work [14:20:22] yes [14:21:11] (sometimes I would say "it sucks for a million reasons" referring to similar many maintenance burden) [14:22:17] haha true [14:22:27] I counted them very carefully [14:22:38] * zhuyifei1999_ facepalm [14:27:05] infobliss: reading through the code, I think https://github.com/infobliss/sibutest2/blob/master/libraries/gen_lib.py#L8 just simply use an exception handler in a more appropriate place is better [14:27:34] I don't see the point of returning 1, '' [14:27:58] json decode can fail for various reasons anyways [14:28:26] also don't "except:" which catches all raiseables [14:29:33] which includes KeyboardInterrupt, SystemExit, etc that shouldn't usually be caught by a generic exception handler [14:30:15] "except Exception:" is preferred [14:32:05] ok [14:32:34] * zhuyifei1999_ gotta zzz [14:32:52] ok sleep. see you later [18:44:37] Hi [18:44:48] Some comments for the logs: [18:45:19] zhuyifei1999_: I'll be here tomorrow 13:30 (Amsterdam time) to discuss with infobliss [18:45:42] and (also @tom) will also work on the first evaluation tomorrow/wednesday [18:46:14] any input for that we can discuss tomorrow or wednesday (although I have to figure out what to exactly put in the review) [18:46:50] @infobliss, https://github.com/infobliss/sibutest2/blob/master/libraries/gen_lib.py#L31 has a lot of issues [18:47:04] It's not really a template [18:47:44] zhuyifei already discussed the part about the template building. But more importantly it seems to still use information which is specific to the nationaalarchief upload [18:48:05] the goal of templating is that you can reuse the template for other glammappings as well [18:48:23] Something more in line with https://github.com/infobliss/sibutest2/blob/master/libraries/infobox_templates.py is prefered [18:49:08] you then call the get_photopraph_parameters in the nationaalarchief code and fill all the parameters which are relevant [18:50:07] the categories can be added seperately [18:50:37] the goal of the templating is to seperate everything which is generic (across multiple uploads) from that what is specific for one upload [18:50:58] thus we can reuse the generic part while keeping the specific parts to a minimum [18:51:09] that also means that the generic functions have to be really generic