1. Список говнокодов пользователя NikitaTsyb

    Всего: 2

  2. Python / Говнокод #29135

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    before = []
    
    def bef():
        global before
        return before
    
    def setB(b):
        global before
        before = b
    
    def foo():
        revert(bef())

    NikitaTsyb, 15 Мая 2025

    Комментарии (1)
  3. Python / Говнокод #29134

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    def pause(c):                                             #replace, assist
        if c > 100: waitLong(c)
        elif c== 1: wait1s()
        elif c== 2: wait2s()
        elif c== 3: wait3s()
        elif c== 5: wait5s()
        elif c== 8: wait8s()
        elif c== 10: wait10s()
        else:
            logger.debug(f"custom timeout, need recheck({c})")
            p(c)   #ping raspberry instead of direct sleep
    
    def p(c):
        time.sleep(c)
    
    def wait1s():
        p(1)
    
    def wait2s():
        wait1s()
        wait1s()
    
    def wait3s():
        logger.debug("one, two, three")
        p(3)   
    
    def wait5s():
        logger.debug("5, 4, 3, 2, 1..")
        p(5)
    
    def wait8s():
        wait5s()
        wait3s()
    
    def wait10s():
        wait5s()
        wait5s()
    
    def waitLong(c):
        logger.debug(f"Attention, wait time is too long({c}), need to replace with waiting for some event or ping")
        p(c)
    
    def cc():
        global client
        client.connect()
        return(client)

    NikitaTsyb, 15 Мая 2025

    Комментарии (6)