[05:15:12] hi zhuyifei1999_ [05:15:17] https://github.com/infobliss/sibutest2/blob/0e0153f46092c3c6c90308813aaa0305d106af5d/glams/NationaalArchiefGLAM.py#L88 [05:15:34] sometimes gives ValueError: too many values to unpack (expected 1) [05:15:41] "ValueError: too many values to unpack (expected 1)" [05:15:52] not always though [05:16:01] ... [05:16:08] And in my local system it never gives this [05:16:18] you have more than one item [05:16:30] yes [05:16:35] print what it is [05:17:08] Do I show them to you? [05:17:23] yeah, print the ones with error [05:18:05] ok [05:18:13] occurs occasionally though [05:23:19] tried twice got no error [05:23:29] but last night it gave this error [05:23:57] this is when you choose National Archief and serach term is "amsterdam" [05:24:07] and hit upload [05:24:37] look, if the problem is not reproduceable I can't debug it [05:24:53] lol [05:25:06] yeah I will report if I get it again [05:28:15] omg [05:28:26] two items coming at a time [05:28:51] https://codeshare.io/G87xzd [05:29:25] well, then you have it [05:29:46] yeah [05:29:55] I will look into it [06:43:49] It is working now [06:44:04] k [11:04:49] zhuyifei1999_ : https://github.com/infobliss/sibutest2/blob/master/app.py#L93 pywikibot cleanup is here [11:05:08] please review when you are free [11:05:19] finally: [11:06:25] Isn't it necessary to have a try block to be able to use a finally block? [11:07:05] yes [11:07:06] https://github.com/infobliss/sibutest2/blob/master/app.py#L122 for multi upload [11:07:34] again, put it in finally: [11:08:26] Can I use this try block https://github.com/infobliss/sibutest2/blob/master/app.py#L88 to add the finally: ? [11:09:42] yes [11:10:03] ok thanks [11:56:27] zhuyifei1999_ dynamic imports work now [11:56:43] will look [11:57:51] k [11:58:00] but where is the registry? [11:59:22] I am not yet able to build the list of glams dynamically [11:59:31] but imports work [12:00:04] k [12:00:54] I am thinking of something like [12:01:07] in app.py: glam_list = register_glam(f) [12:01:35] where f is a glam class [12:02:18] but issue is where do I get that f from [12:02:19] ? [12:02:42] I told you, decorator [12:02:49] @register_glam [12:02:57] not register_glam(c) [12:03:33] they are equivalent, but with decorator they are automatically provided [12:04:19] I will be unavailable starting from tomorrow morning of my time [12:04:22] is this '@register_glam' going to be inside __init__.py inside glams folder? [12:04:33] no [12:04:44] right above each glam class [12:05:07] eg: [12:05:28] @register_glam [12:05:30] class AmsterdamMuseumGLAM(GenericGLAM): [12:05:30] ... [12:06:05] that much [12:07:06] but where is the definition? [12:07:12] __init__.py [12:07:28] before dynamic import [12:07:33] inside glams folder? [12:07:49] ok [12:07:51] yes [12:08:06] dynamic import goes last [12:08:42] then the list formed by the function inside __init__.py will be accessible in app.py? [12:08:48] yes [12:09:16] the list has to also be before dynamic import [12:09:39] the list is formed but not returned right? [12:09:53] what do you mean by return? [12:10:02] the module body cannot return [12:10:08] ok [12:10:43] ok thanks let me try [12:27:09] Is this correct https://codeshare.io/5w4zbK ? [12:28:48] https://github.com/infobliss/sibutest2/blob/master/glams/AmsterdamMuseumGLAM.py#L17 I have @register_glam [12:55:35] zhuyifei1999_ : getting "NameError: name 'register_glam' is not defined" [12:56:06] did you import? [12:56:42] 20:27 Is this correct https://codeshare.io/5w4zbK ? <= I think so [12:58:16] did you import? <= yes in app.py [12:59:19] module = loader.find_module(module_name).load_module(module_name) line gives error. [12:59:26] ... [12:59:27] previous ones are fine [12:59:39] did you import register_glam? [12:59:47] no [12:59:48] from the files where you have @register_glam [13:00:07] well, of course they aren't defined if you don't import [13:01:48] it's inside __init__.py of glams folder [13:02:13] what should be import statement? [13:15:09] zhuyifei1999_: I am unable to import register_glam from __init__.py into NationalArchiefGLAM.py where I have @register_glam [13:18:06] ? [13:20:02] I tried in several ways [13:20:23] import register_glam says no module named register_glam [13:20:26] and [13:21:12] from __init__ import register_glam says no module named __init__ [13:24:48] ... [13:24:59] from glams import register_glam [13:25:47] wow [13:25:53] it worked :) [13:26:04] thanks a lot for hearing patiently [13:27:10] np [18:41:12] hi [18:44:14] did I miss you infobliss, sorry dinner went a bit late [19:05:58] hi basvb sorry I had fallen asleep [19:06:10] are you there? [19:08:21] anyways please read the logs to see what tasks were done today [19:08:41] docs are being created and will be finished soon