프로젝트

일반

사용자정보

개정판 e2420413

IDe2420413803557e9bc796c88e9deb6c311f95908
상위 41566841
하위 1fe77690, 888b05a3

백흠경이(가) 약 5년 전에 추가함

issue #641: 신규 도면이 데이타베이스에 저장되지 않는 현상 수정

Change-Id: Id9db5464ade5fb2991189ca57cbcf185e107d4e8

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
3468 3468
                    cursor.execute('begin')
3469 3469

  
3470 3470
                for drawing in drawings:
3471
                    image_blob_data = None
3472
                    file_path = os.path.join(self.project.getDrawingFilePath(), drawing.name)
3473
                    if drawing.name and os.path.isfile(file_path):
3474
                        with open(file_path.encode('utf-8'), 'rb') as file:
3475
                            image_blob_data = file.read()
3476

  
3477 3471
                    if drawing.UID is None:
3472
                        # get image data
3473
                        image_blob_data = None
3474
                        file_path = os.path.join(self.project.getDrawingFilePath(), drawing.name)
3475
                        if drawing.name and os.path.isfile(file_path):
3476
                            with open(file_path.encode('utf-8'), 'rb') as file:
3477
                                image_blob_data = file.read()
3478
                        # up to here
3479

  
3478 3480
                        sql = self.project.database.to_sql(
3479
                            'insert into Drawings(UID, [NAME], [DATETIME], Image) values(?, ?, ?, ?)')
3480
                        param = tuple([str(uuid.uuid4()), drawing.name, '', None])
3481
                        #param = tuple([str(uuid.uuid4()), drawing.name, '', image_blob_data])
3481
                            'insert into Drawings(UID, [NAME], [DATETIME], [Image]) values(?, ?, ?, ?)')
3482
                        param = tuple([str(uuid.uuid4()), drawing.name, '', image_blob_data])
3483
                        drawing.UID = param[0]
3482 3484
                    else:
3483 3485
                        sql = self.project.database.to_sql("update Drawings set [NAME]=?,[DATETIME]=? where UID=?")
3484 3486
                        param = (drawing.name, drawing.datetime, str(drawing.UID))

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)