[05:22:10] hi zhuyifei1999_ [05:22:47] I had sent a request for approval of the OAuth consumer for glam2commons [05:22:49] https://meta.wikimedia.org/wiki/Steward_requests/Miscellaneous#OAuth_approval_request_for_glam2commons [05:23:00] k [05:23:15] basvb was suggesting if you could ask some people to get it approved [05:23:28] uh [05:23:43] I don't know mjany stewards [05:23:52] ok no problems [05:25:00] oh and idk why this approving should be stewards' task [05:25:09] most of them aren't devs [05:25:38] oh ok [05:26:02] but anyways, someone should process it soon [05:26:02] not a big issue [05:26:14] yeah [05:26:30] In the next few hours I will try to get the imports happen dynamically [05:26:37] k [05:28:06] and I will be unavailable from 2 pm to 3:30 pm my time [11:26:02] hi zhuyifei1999_ [11:26:05] [12:10:33] def register_glam(c): [11:26:13] yeah? [11:26:14] [12:10:33] glamlist.append(c) [11:26:25] [12:10:33] return c [11:26:58] I suppose c is the module name here [11:27:05] no [11:27:10] it's the function [11:27:26] why would you care about modules... [11:27:34] except when importing [11:28:26] I am not sure why it accepts c and also returns the same c [11:29:16] it adds c to a list [11:29:33] sure [11:29:39] you know how decorators work right [11:29:45] nope [11:29:52] ... [11:29:54] a sec [11:31:07] https://wiki.python.org/moin/PythonDecorators [11:32:05] basically [11:32:12] a construct like [11:32:20] @some_decorator [11:32:30] def some_func(): [11:32:37] is the same as [11:32:46] def some_func(): [11:33:00] ... function body [11:33:09] some_func = decorator(some_func) [11:33:31] this is also applicable to class constructs [11:34:23] ACTION is reading more about it [11:36:39] or google 'python decorator' [11:38:50] yeah [11:38:57] read some examples [11:39:28] most of them alter how the decorated function/method/class works [11:39:48] but we can also use it to register the parameter [11:40:23] what does register mean? [11:40:37] since the decorators always get the decorated function/method/class as their parameter [11:40:53] https://en.wiktionary.org/wiki/register [11:41:23] https://en.wiktionary.org/wiki/register#Verb #3 [11:42:12] I know the English meaning though [11:42:29] was asking if it has any specific contextual meaning here [11:42:56] basically add-the-thing-to-the-list [11:43:14] the list acts like a registry [11:43:48] ok got it [11:43:55] well, it doesn't have to be a list. it can also be a set [11:44:47] so we build a list/set of functions [11:45:15] actually glam classes [11:45:20] or better a list/set of GLAM classes [11:45:38] yeah [11:45:59] now I see the use [11:46:57] but we need to have the parameters first [11:47:05] ? [11:47:34] parameter = c in our function register_glam(c) [11:47:42] ... [11:47:58] 19:40 since the decorators always get the decorated function/method/class as their parameter [11:48:06] use @ [11:48:07] quoting from [12:12:30] def register_glam(c): [11:48:30] ? [11:48:49] never mind [11:48:55] I will rephrase [11:49:18] to be able to build the set/list of GLAM classes we need to know what they are [11:49:31] https://stackoverflow.com/questions/3365740/how-to-import-all-submodules is for the same purpose [11:49:39] yeah so? [11:49:50] it gives error to me [11:49:58] what error? [11:50:08] NameError: global name '__path__' is not defined [11:50:14] ... [11:50:21] are you using it in a file? [11:50:33] or are you just using an interactive shell? [11:51:15] file [11:53:48] Do I give the path explicitly? [11:53:56] ACTION is reading __path__ [11:54:12] uh https://stackoverflow.com/questions/2003859/where-is-the-path-comes-from [11:56:30] hmm may be __init__.py is needed [11:56:33] let me try [11:57:46] no [11:58:05] I'm looking into this [11:58:34] ok [12:00:02] ah, it works if it's in __init__ [12:00:26] so put that dynamic loader inside the glam __init__.py [12:00:38] *if it's in __init__.py [12:00:56] a sec [12:03:07] no luck [12:03:18] ? [12:03:42] I got same error [12:04:02] https://www.irccloud.com/pastebin/ac9pJS0l/ [12:05:32] let me see [12:11:29] your commons do work for me [12:11:33] *commands [12:12:11] well, then it's probably your problem if you can't get your way to work :P [12:12:42] yeah [17:55:55] hoi [18:02:27] hello [18:04:41] how is it going? [18:04:56] hoi [18:07:12] hi was afk [18:07:45] I am getting my way to get the dynamic imports happen [18:07:55] should be finished soon [18:09:06] I had an understanding regarding the use of decorators for our purpose [18:10:39] ok [18:10:52] if the oauth for glam2commons is ready we can get it tested [18:11:00] but then I think for tomorrow you know what to do? [18:12:11] glam2commons OAuth is approved I will have the code migrated from sibutest to glam2commons [18:12:15] and test once [18:12:30] and then inform you when it can be tested by users [18:13:00] tomorrow after finishing dynamic imports documentation is to be done [18:14:47] ok ;) [18:16:25] I had framed a few questions for feedback [18:16:35] have you seen? [18:17:01] no, where [18:17:13] last night itself [18:17:23] you may find them in the logs [18:19:01] ok, I'll use those in what I will write for the village pumo [18:19:01] pump [18:19:27] ok [18:19:53] if the oauth for glam2commons is ready we can get it tested [18:20:22] yeah not ready yet, give me some time for migration and testing [18:20:49] I will inform you say tomorrow morning [18:21:37] "[23:42] glam2commons OAuth is approved I will have the code migrated from sibutest to glam2commons" [18:22:27] yep [18:26:18] Is there anything else for today? [18:29:54] not from my side [18:30:19] ok then I may get back to work [18:30:36] a short meeting for today [18:32:42] yeo [18:32:53] alright