[00:24:48] opka: о fuzzy
[00:25:33] opka: fuzzy: https://privatepaste.com/c1086d1876/LKJkljK(*ysdiuaha
[00:27:37] gigimon is now online
[00:27:44] fuzzy: в чём вопрос?
[00:28:47] opka: Помогите мне с правильной оптимизацией. Возможно, подойдет какой-то шабло нпроектирования я хз. Смущает, что все функции однотипные и я их по началу делал так. Сейчас их будет более 20, и городить однотипное уже не так забавно. Как избавиться от повторяющегося кода?
[00:28:57] fuzzy: какие функции?
[00:29:00] opka: хочу сделать рефакторинг ненмого :) но не могу придумать как
[00:29:43] gigimon is now offline
[00:29:56] fuzzy: я не совсем понимаю, где у тебя код повторяется
[00:29:58] opka: some1_upload, some2_uplaod они идентицчны, разнциа лишь в site = Site()
[00:30:11] fuzzy: а
[00:30:17] fuzzy: ну так сделай upload() методом site
[00:30:18] opka: def some1_upload(tmp_packet): - у меня таких уже 8
[00:30:35] fuzzy: и у каждого Site() своя реализация метода
[00:30:50] fuzzy: а воркер просто выбирает сайт и пакет из очереди и делает site.upload(packet)
[00:31:04] opka: это типа полиморфизм ?:)
[00:32:19] opka: В классах Some() у меня два метода login_to, uplaod.
[00:32:54] opka: *upload
[00:36:15] opka: короче я запутался
[00:36:47] fuzzy: да
[00:36:50] fuzzy: полиморфизм
[00:37:09] opka: получается, у меня будет тожесамое всё, но только в каждом классе? :)
[00:37:23] fuzzy: почему то же самое?
[00:37:30] fuzzy: сделай тогда метод login_and_upload()
[00:37:45] fuzzy: который вызывает self.login_to() и self.upload()
[00:37:55] fuzzy: а в очереди вызывай просто site.login_and_upload()
[00:38:18] fuzzy: Базовый класс BaseSite(object) определяет общий для всех метод login_and_upload().
[00:38:29] opka: ну да, а в login_upload будут циклы?
[00:38:40] opka: for.. while.. ?
[00:39:01] fuzzy: можешь в него перенести всё, что у тебя в some1_upload
[00:39:33] fuzzy: только вместо site = Some1() у тебя будет site = self
[00:40:12] opka: идею я понял, пойду смотреть ,как организовывают в питоне ооп :)
[00:40:19] opka: спс :)
[01:00:04] bliznezz is now offline
[01:00:52] bliznezz is now away
[01:20:00] fuzzy is now away
[01:20:44] fuzzy is now online
[01:27:47] fuzzy is now away
[01:29:21] AlexZenon is now xa
[01:32:52] fuzzy is now away
[01:35:54] tranq is now offline
[01:37:16] Tony is now away
[01:38:03] opka is now offline
[01:59:30] mrDoctorWho is now offline
[02:00:18] Сволота is now online
[02:02:16] Tony is now xa
[02:02:49] fuzzy is now away
[02:26:16] madmercen is now online
[02:27:59] fuzzy is now away
[02:28:27] fuzzy is now online
[02:41:04] gigimon is now online
[02:41:17] gigimon is now offline
[02:42:09] gigimon is now online
[02:42:23] gigimon is now offline
[02:45:47] fuzzy is now away
[02:48:40] Сволота is now away
[02:49:32] Сволота is now online
[02:55:33] madmercen is now away
[02:55:47] fuzzy is now away
[02:59:11] madmercen is now online
[03:07:19] madmercen is now away
[03:15:19] madmercen is now xa
[03:16:29] gigimon is now online
[03:16:44] gigimon is now offline
[03:28:35] madmercen is now online
[03:36:15] madmercen is now away
[03:44:15] madmercen is now xa
[03:49:09] gigimon is now online
[03:49:24] gigimon is now offline
[03:56:57] madmercen is now online
[04:04:31] madmercen is now away
[04:08:15] madmercen is now online
[04:18:43] madmercen is now away
[04:26:43] madmercen is now xa
[04:42:35] fuzzy is now away
[05:03:47] madmercen is now online
[05:33:51] Сволота is now online
[05:33:51] Tony is now xa
[05:33:51] bliznezz is now away
[05:33:51] madmercen is now online
[05:33:51] fuzzy is now away
[05:33:51] Magister Yoda is now xa
[05:33:51] AlexZenon is now xa
[05:33:51] magic_pony is now online
[05:33:51] : slav0nic установил(а) тему: python.su | Сначала поищи ответ на docs.python.org | Теперь поищи в google.com | Код постить в dumpz.org | Хочешь задать вопрос - просто *задай* его! | Правила написания хорошего кода: http://➡.ws/pep8 | Логи: http://logs.python.su
[05:51:55] madmercen is now away
[05:55:13] madmercen is now online
[06:25:23] Сволота is now online
[06:25:23] bliznezz is now away
[06:25:23] Tony is now xa
[06:25:23] fuzzy is now away
[06:25:23] madmercen is now online
[06:25:23] AlexZenon is now xa
[06:25:23] Magister Yoda is now xa
[06:25:23] magic_pony is now online
[06:25:23] : slav0nic установил(а) тему: python.su | Сначала поищи ответ на docs.python.org | Теперь поищи в google.com | Код постить в dumpz.org | Хочешь задать вопрос - просто *задай* его! | Правила написания хорошего кода: http://➡.ws/pep8 | Логи: http://logs.python.su
[06:37:26] Сволота is now away
[06:38:00] Сволота is now online
[06:52:50] Сволота is now away
[07:02:50] Сволота is now xa
[07:15:39] fuzzy is now away
[07:16:56] Сволота is now online
[07:47:07] Сволота is now online
[07:47:07] Tony is now xa
[07:47:07] bliznezz is now away
[07:47:07] madmercen is now online
[07:47:07] fuzzy is now away
[07:47:07] Magister Yoda is now xa
[07:47:07] AlexZenon is now xa
[07:47:07] magic_pony is now online
[07:47:07] : slav0nic установил(а) тему: python.su | Сначала поищи ответ на docs.python.org | Теперь поищи в google.com | Код постить в dumpz.org | Хочешь задать вопрос - просто *задай* его! | Правила написания хорошего кода: http://➡.ws/pep8 | Логи: http://logs.python.su
[07:47:08] dicos is now online
[07:50:46] dicos is now away
[07:50:47] dicos is now away
[08:06:37] dicos is now away
[08:06:38] dicos is now online
[08:11:37] dicos is now away
[08:11:38] dicos is now away
[08:12:51] fuzzy is now away
[08:22:56] dicos is now away
[08:22:57] dicos is now online
[08:52:59] Сволота is now online
[08:52:59] Tony is now xa
[08:52:59] bliznezz is now away
[08:52:59] madmercen is now online
[08:52:59] fuzzy is now away
[08:52:59] Magister Yoda is now xa
[08:52:59] AlexZenon is now xa
[08:52:59] dicos is now online
[08:52:59] magic_pony is now online
[08:52:59] : slav0nic установил(а) тему: python.su | Сначала поищи ответ на docs.python.org | Теперь поищи в google.com | Код постить в dumpz.org | Хочешь задать вопрос - просто *задай* его! | Правила написания хорошего кода: http://➡.ws/pep8 | Логи: http://logs.python.su
[09:03:30] dicos is now away
[09:03:31] dicos is now away
[09:08:36] dicos is now away
[09:08:37] dicos is now online
[09:16:32] Сволота is now away
[09:18:06] Сволота is now online
[09:30:03] bliznezz is now offline
[09:30:32] bliznezz is now away
[09:30:54] Сволота is now away
[09:31:08] Tony is now online
[09:36:32] Сволота is now online
[09:41:34] Сволота is now away
[09:44:50] madmercen is now away
[09:47:26] madmercen is now online
[09:51:35] Сволота is now xa
[09:57:00] Сволота is now online
[10:03:56] tranq is now online
[10:04:50] tranq is now online
[10:06:56] tranq is now offline
[10:08:08] tranq is now online
[10:17:08] Сволота is now away
[10:17:46] Сволота is now online
[10:22:48] Сволота is now away
[10:28:46] Tony is now away
[10:31:52] madmercen is now away
[10:32:48] Сволота is now xa
[10:34:01] AlexZenon is now offline
[10:36:48] fuzzy is now online
[10:37:42] Сволота is now online
[10:39:42] fuzzy is now away
[10:39:52] madmercen is now xa
[10:42:42] Сволота is now away
[10:42:47] Сволота is now online
[10:48:14] Сволота is now away
[10:51:18] Сволота is now online
[10:53:46] Tony is now xa
[10:53:54] madmercen is now online
[10:57:24] Сволота is now away
[10:57:24] mrDoctorWho is now online
[11:05:28] Сволота is now online
[11:05:29] fuzzy is now away
[11:11:32] madmercen is now away
[11:14:19] fuzzy is now away
[11:16:22] Сволота is now away
[11:19:32] madmercen is now xa
[11:24:34] fuzzy is now away
[11:26:22] Сволота is now xa
[11:34:05] dicos is now away
[11:34:06] dicos is now away
[11:37:10] Сволота is now online
[11:39:11] dicos is now away
[11:39:13] dicos is now online
[11:52:43] fuzzy is now away
[12:00:14] dicos is now offline
[12:05:28] mrDoctorWho is now away
[12:07:33] mrDoctorWho is now online
[12:08:28] fuzzy is now away
[12:09:14] fuzzy is now away
[12:11:05] mrDoctorWho is now offline
[12:11:15] mrDoctorWho is now online
[12:25:12] Сволота is now away
[12:25:28] Сволота is now online
[12:26:49] gigimon is now online
[12:29:57] tranq is now offline
[12:30:40] Сволота is now away
[12:32:42] fuzzy is now away
[12:33:46] Сволота is now online
[12:36:55] fuzzy is now away
[12:53:35] Tony is now online
[13:01:11] fuzzy is now away
[13:04:19] fuzzy is now away
[13:11:56] madmercen is now online
[13:20:40] madmercen is now away
[13:23:34] Tony is now away
[13:28:40] madmercen is now xa
[13:33:18] madmercen is now online
[13:34:20] fuzzy is now away
[13:38:54] tranq is now online
[13:42:32] fuzzy is now away
[13:46:26] madmercen is now away
[13:48:34] Tony is now xa
[13:53:00] madmercen is now online
[13:59:19] AlexZenon is now online
[14:13:14] fuzzy is now away
[14:14:49] levsha is now online
[14:25:39] fuzzy is now away
[14:30:05] levsha is now online
[14:36:18] Tony is now online
[14:37:41] mrDoctorWho is now away
[14:38:49] fuzzy is now away
[14:44:08] madmercen is now away
[14:46:09] mrDoctorWho is now online
[14:46:27] fuzzy is now away
[14:46:29] gigimon is now online
[14:51:38] gigimon is now away
[14:52:08] madmercen is now xa
[14:54:39] slav0nic is now online
[14:59:40] gigimon is now away
[14:59:40] gigimon is now online
[15:01:22] fuzzy is now away
[15:03:31] fuzzy is now away
[15:05:19] mrDoctorWho is now offline
[15:06:18] Tony is now away
[15:17:50] gigimon is now online
[15:27:50] levsha is now online
[15:28:01] gigimon is now online
[15:29:38] fuzzy is now away
[15:31:18] Tony is now xa
[15:32:12] fuzzy is now away
[15:32:37] ambush is now away
[15:33:13] ambush is now online
[15:37:08] levsha is now offline
[15:45:08] fuzzy is now online
[15:45:26] fuzzy is now away
[15:46:53] fuzzy is now online
[15:55:52] gigimon is now online
[15:55:52] gigimon is now offline
[15:57:10] gigimon is now online
[15:58:41] vaal is now online
[16:01:07] vaal is now offline
[16:05:26] fuzzy is now away
[16:06:10] slav0nic is now away
[16:09:15] gigimon is now offline
[16:11:38] slav0nic is now online
[16:12:09] ambush is now away
[16:13:53] ambush is now online
[16:15:17] fuzzy is now online
[16:18:03] fuzzy is now away
[16:18:03] fuzzy is now online
[16:19:21] fuzzy is now away
[16:19:22] fuzzy is now online
[16:24:21] fuzzy is now away
[16:28:11] mrDoctorWho is now online
[16:33:28] slav0nic is now away
[16:34:56] slav0nic is now online
[16:37:56] levsha is now online
[16:40:55] fuzzy is now online
[16:42:19] mrDoctorWho is now offline
[16:42:27] fuzzy is now offline
[16:46:15] slav0nic is now away
[16:46:42] fuzzy is now online
[16:48:27] fuzzy is now offline
[16:48:40] Сволота is now away
[16:50:56] levsha is now offline
[16:56:14] slav0nic is now xa
[16:58:40] Сволота is now xa
[17:03:07] fuzzy is now online
[17:06:02] levsha is now online
[17:10:45] fuzzy is now away
[17:14:12] fuzzy is now online
[17:18:44] fuzzy is now away
[17:21:33] fuzzy is now online
[17:25:14] Tony is now online
[17:31:08] fuzzy is now away
[17:31:14] fuzzy is now online
[17:32:15] fuzzy is now away
[17:32:26] slav0nic is now online
[17:35:49] fuzzy is now online
[17:37:27] slav0nic is now away
[17:39:38] fuzzy is now away
[17:42:10] Сволота is now online
[17:42:10] fuzzy is now online
[17:42:40] fuzzy is now away
[17:47:12] Сволота is now away
[17:47:26] slav0nic is now xa
[17:48:29] ambush is now away
[17:52:18] fuzzy is now online
[17:52:21] fuzzy is now offline
[17:56:25] vaal is now online
[17:57:12] Сволота is now xa
[17:57:45] vaal is now offline
[17:58:29] ambush is now xa
[17:58:46] Сволота is now online
[17:59:03] ambush is now online
[18:01:46] slav0nic is now online
[18:03:48] Сволота is now away
[18:08:03] ambush is now away
[18:11:06] Сволота is now online
[18:16:08] Сволота is now away
[18:18:03] ambush is now xa
[18:20:55] levsha is now online
[18:20:55] levsha is now away
[18:21:00] levsha is now away
[18:21:00] levsha is now offline
[18:26:08] Сволота is now xa
[18:27:28] levsha is now away
[18:27:31] levsha is now away
[18:27:33] levsha is now online
[18:29:19] mrDoctorWho is now online
[18:30:03] bliznezz is now offline
[18:30:42] bliznezz is now away
[18:34:05] ambush is now online
[18:37:52] Сволота is now online
[18:39:07] ambush is now away
[18:44:40] Сволота is now away
[18:49:07] ambush is now xa
[18:51:58] levsha is now offline
[18:53:08] levsha is now online
[18:54:40] Сволота is now xa
[18:56:04] Сволота is now online
[19:01:06] Сволота is now away
[19:06:33] levsha is now offline
[19:06:33] levsha is now online
[19:11:06] Сволота is now xa
[19:15:36] levsha is now away
[19:16:06] levsha is now online
[19:18:11] levsha is now away
[19:20:15] slav0nic is now away
[19:24:18] Сволота is now online
[19:26:17] levsha is now away
[19:27:16] levsha is now away
[19:27:16] levsha is now offline
[19:29:34] Tony is now away
[19:30:15] slav0nic is now xa
[19:32:12] slav0nic is now online
[19:34:08] levsha is now away
[19:34:09] levsha is now away
[19:34:14] levsha is now online
[19:44:36] Tony is now online
[19:45:23] levsha is now offline
[20:12:07] slav0nic is now away
[20:12:23] slav0nic is now online
[20:15:22] madmercen is now online
[20:32:25] vaal is now online
[20:32:30] vaal is now offline
[20:44:21] Tony is now away
[20:47:15] Magister Yoda is now online
[20:49:57] Tony is now online
[20:55:14] огыешсук is now online
[21:00:43] Magister Yoda is now away
[21:02:12] levsha is now online
[21:05:46] огыешсук is now online
[21:05:53] огыешсук is now online
[21:09:24] madmercen is now away
[21:17:16] levsha is now online
[21:17:24] madmercen is now xa
[21:18:30] tranq is now offline
[21:20:43] Magister Yoda is now xa
[21:36:03] levsha is now online
[21:47:48] levsha is now online
[22:02:16] Сволота is now away
[22:08:51] tranq is now online
[22:12:16] Сволота is now xa
[22:15:14] ambush is now online
[22:23:00] levsha is now online
[22:23:43] slav0nic is now away
[22:24:11] slav0nic is now online
[22:36:35] levsha is now online
[22:36:58] Сволота is now online
[22:38:23] slav0nic is now away
[22:41:58] Сволота is now away
[22:43:18] Сволота is now online
[22:48:24] slav0nic is now xa
[22:48:24] Сволота is now away
[22:48:45] slav0nic is now online
[22:49:12] Сволота is now online
[22:50:34] Magister Yoda is now online
[22:53:50] ambush is now away
[22:57:54] ambush is now online
[23:00:13] levsha is now online
[23:02:09] Magister Yoda is now away
[23:08:50] Сволота is now away
[23:09:50] Сволота is now online
[23:11:09] mrDoctorWho is now away
[23:17:57] levsha is now offline
[23:18:11] levsha is now online
[23:19:25] mrDoctorWho is now online
[23:20:22] slav0nic is now away
[23:20:52] ambush is now away
[23:22:09] Magister Yoda is now xa
[23:30:22] slav0nic is now xa
[23:30:52] ambush is now xa
[23:33:53] slav0nic is now online
[23:46:52] ambush is now online
[23:51:55] ambush is now away
[23:54:51] ambush is now online