Пример #1
0
def Send():
    user = config.USER
    password = config.PASSWORD
    to_addr = config.TO_ADDR
    from_addr = config.FROM_ADDR
    host = config.HOST

    sbj = "[BilibiliUP]"

    # 获取所有有更新的UP主,并添加到主题中
    cards = Dynamic.ListUpdate()
    # 没有更新时不发送
    if len(cards) == 0:
        if config.DEBUG == True:
            print("没有更新")
        return
    for card in cards:
        if sbj.find(card.uname) == -1:
            sbj = sbj + ' ' + card.uname

    # 构建发送内容与头部
    msg = MIMEText(__CreateHTML(cards), "html", "utf-8")
    msg['From'] = __format_addr("BilibiliUP<*****@*****.**>")
    msg['To'] = __format_addr("Anscor<*****@*****.**>")
    msg['Subject'] = Header(sbj, "utf-8").encode()

    # 发送
    server = smtplib.SMTP(host, 25)
    if config.DEBUG == True:
        server.set_debuglevel(True)
    server.login(user, password)
    server.sendmail(from_addr, [from_addr, to_addr], msg.as_string())
    server.quit()
Пример #2
0
 def print_dynamic(
     self
 ):  # Function that prints the frame responsible for dynamic loading
     MainScreen.first_frame.pack_forget()
     self.frame_dynamic.pack()
     window.title('Dynamic Loading')
     easy_grid([
         Label(self.frame_dynamic,
               bg=styles.frame_background,
               text='Select a method',
               font=(styles.font, 30)),
         Button(self.frame_dynamic,
                text="Stress-life",
                font=(styles.font, 24),
                bg=styles.button_background,
                bd=styles.button_border,
                activebackground=styles.button_active,
                command=lambda: Dynamic.StressLife())
     ], 1, 0, 0)
Пример #3
0
#!/usr/bin/python2.7

import Dynamic

__author__ = 'WendyYu'

if __name__ == '__main__':
    group_no_hue = 0
    hue_body_list = ['{"xy":[0.4308, 0.5042], "bri":2}', '{"xy":[0.3804, 0.3768], "bri":2}',
                     '{"xy":[0.1616, 0.3738], "bri":2}', '{"xy":[0.3804, 0.3768], "bri":2}',
                     '{"xy":[0.4224, 0.1779], "bri":2}', '{"xy":[0.3804, 0.3768], "bri":2}']

    try:
        # while True:
        print "\nColor gamut middle point to 4000k and bri:1 test\n"
        Dynamic.execute(group_no_hue, hue_body_list)
        Dynamic.color_gamut.write_log_all("Color_gamut_TC15", "./logs/color_gamut_xy")

    except KeyboardInterrupt:
        input("\nPress any key to quit...")

    except Exception as e:
        print "\n\033[1;31;0m%s\033[0m" % e
#!/usr/bin/python2.7

import Dynamic

__author__ = 'WendyYu'

if __name__ == '__main__':
    group_no_hue = 0
    hue_body_list = ['{"xy":[0.4308, 0.5042], "bri":254}', '{"xy":[0.4308, 0.5042], "bri":1, "transitiontime":600}',
                     '{"xy":[0.1616, 0.3738], "bri":254}', '{"xy":[0.1616, 0.3738], "bri":1, "transitiontime":600}',
                     '{"xy":[0.4224, 0.1779], "bri":254}', '{"xy":[0.4224, 0.1779], "bri":1, "transitiontime":600}']

    try:
        # while True:
        print "\nColor gamut middle point for bri transition test"
        Dynamic.execute(group_no_hue, hue_body_list)
        Dynamic.color_gamut.write_log_all("Color_gamut_bri_TC3", "./logs/color_gamut_bri")

    except KeyboardInterrupt:
        input("\nPress any key to quit...")
Пример #5
0
            li = self.listItem
            li = li.replace('{ UPName }', key)

            vfs = ''
            for card in value:
                vfs = vfs + self.__RenderVideoInfo(card)
            li = li.replace('{ VideoInfo }', vfs)

            listItems = listItems + li

        result = result.replace('{ list-item }', listItems)

        return result

    def __RenderVideoInfo(self, card):
        vi = self.videoInfo

        vi = vi.replace('{ VideoLink }',
                        'https://www.bilibili.com/video/av' + str(card.av))
        vi = vi.replace('{ CoverImgSrc }', card.cover + '@160w_100h.webp')
        vi = vi.replace('{ VideoTitle }', card.title)
        vi = vi.replace('{ VideoDescription }',
                        card.desc.replace('\n', '<br />'))

        return vi


if __name__ == '__main__':
    cs = Dynamic.ListUpdate()
    pr = PageRenderer()
    print(pr.Render(cs))
Пример #6
0
max_frameskip = 5

next_game_tick = pygame.time.get_ticks()
loops = 0
interpolation = 0

windowSurfaceObj = pygame.display.set_mode((SCRWIDTH, SCRHEIGHT))
pygame.display.set_caption('Game')

mousex, mousey = 0, 0

domain = Domain(100, (SCRWIDTH/2, SCRHEIGHT/2))
domain.v_scal = 10

for i in range(5):
    dyna = Dynamic(304, 224, homepath + 'bot.png')
    dyna.vx = randint(-1, 1)
    dyna.vy = randint(-1, 1)
    if dyna.vx == 0 and dyna.vy == 0:
        dyna.vx = 1
    dyna.normalize()
    #dyna.point_to_vel_vector()
    dyna.v_scal = randint(10, 15)
    domain.add_fish(dyna)

worldMap = WorldMap("map2_tiles_only.tmx")

domain.rel_offset_y = abs(worldMap.world_map.pixel_height - SCRHEIGHT)

running = True
Пример #7
0
import numpy as np
import cv2
import Dynamic

htmap_root = '/home/lechatelia/Desktop/CPM-boundary-data/145538AA/stage6_htmap/'

test_img = '/home/lechatelia/Desktop/CPM-boundary-data/145538AA/stage6_htmap/pred_lane-238.jpg'

img = cv2.imread(test_img)
img_show = Dynamic.Generate_Route(img)

cv2.namedWindow('img')
cv2.imshow('img', img)
cv2.namedWindow('img_show')
cv2.imshow('img_show', img_show)
cv2.waitKey(0)
Пример #8
0
#!/usr/bin/python2.7

import Dynamic

__author__ = 'WendyYu'

if __name__ == '__main__':
    group_no_gu10 = 3
    gu10_light_list = [53, 32, 31, 28, 22, 14, 11, 42, 36, 38, 19, 41, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]
    gu10_body_list = ['{"on":true, "bri":50, "ct":153}', '{"bri":160, "ct":250}', '{"on":false, "transitiontime":100}',
                      '{"on":true, "bri":225, "ct":370}', '{"bri":254, "ct":454}', '{"on":false}'
                      ]
    try:
        while True:
            print "\nGu10 and BR30 Tone dynamic Test Start\n"
            Dynamic.execute(group_no_gu10, gu10_light_list, gu10_body_list)
            Dynamic.dynamic_test.write_log_all("Dynamic_Tone", "./logs/dynamic/Tone")

    except KeyboardInterrupt:
        input("\nPress any key to quit...")
Пример #9
0
#!/usr/bin/python2.7

import Dynamic

__author__ = 'WendyYu'

if __name__ == '__main__':
    # group_no_lux = 2
    group_no_lux = 0
    # lux_light_list = [29, 23, 20, 1, 43, 8, 44, 27, 6, 39, 34, 52]
    lux_light_list = [1, 2, 4, 5, 7, 9, 10, 11, 12, 16, 17, 18, 19]
    lux_body_list = [
        '{"on":true, "bri":1, "transitiontime":50}', '{"bri":254}',
        '{"on":false, "transitiontime":50}', '{"on":true, "bri":160}',
        '{"on":true, "bri":225}', '{"bri":254}', '{"on":false}'
    ]
    try:
        while True:
            print "\nLux dynamic Test Start"
            Dynamic.execute(group_no_lux, lux_light_list, lux_body_list)
            Dynamic.dynamic_test.write_log_all("Dynamic_lux",
                                               "./logs/dynamic/lux")

    except KeyboardInterrupt:
        input("\nPress any key to quit...")
Пример #10
0
#!/usr/bin/python2.7

import Dynamic

__author__ = 'WendyYu'

if __name__ == '__main__':
    # group_no_lux = 2
    group_no_lux = 0
    # lux_light_list = [29, 23, 20, 1, 43, 8, 44, 27, 6, 39, 34, 52]
    lux_light_list = [1, 2, 4, 5, 7, 9, 10, 11, 12, 16, 17, 18, 19]
    lux_body_list = ['{"on":true, "bri":1, "transitiontime":50}', '{"bri":254}',
                     '{"on":false, "transitiontime":50}', '{"on":true, "bri":160}',
                     '{"on":true, "bri":225}', '{"bri":254}',
                     '{"on":false}'
                     ]
    try:
        while True:
            print "\nLux dynamic Test Start"
            Dynamic.execute(group_no_lux, lux_light_list, lux_body_list)
            Dynamic.dynamic_test.write_log_all("Dynamic_lux", "./logs/dynamic/lux")

    except KeyboardInterrupt:
        input("\nPress any key to quit...")
Пример #11
0
#! /usr/bin/python
# coding:utf-8

import Dynamic

if __name__ == '__main__':
    import sys,os
    cmd = sys.argv[1]
    log_name = './log/'+cmd.replace(' ','_')+'.txt'
    cmd = 'qemu-x86_64 /bin/'+cmd+' 2>'+log_name
    print cmd
    os.system(cmd)
    print 'Error Log:'
    os.system('cat '+log_name)
    print "Count result:"
    ans = Dynamic.count(log_name)
    count_txt = sys.argv[1].replace(' ','_')+' '+' '.join(['%d'%i for i in ans])
    if not raw_input('Save?(Y/n)').startswith('n'):
        os.system('echo "' +count_txt+'">>ans.txt')