id_photo.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:id_photo 作者: aeifn 项目源码 文件源码
def auto_execute(self, widget, data=None):
    # ???????? ????, ???? ?? ??????
    self.window.hide()
    gimp.context_push()
    # ????????? ?????? ?????????? UNDO
    self.image.undo_group_start()
    # ???????? "????-??????"
    if self.autolevels_check.get_active():
      auto_levels = True
    else:
      auto_levels = False
    # ???? ???????? gtk.RadioButton
    for format_id in self.format_radio:
      if format_id.get_active():
        # ????????? ??????? ??????? ? ??????? ? ???????
        tmp_dict = self.data['formats'][self.format_radio.index(format_id)]
        tmp_dict['resolution'] = self.data['properties']['resolution']
        shelf['format'] = tmp_dict

        # ???? gtk.RadioButton ??????? ???????? ???????, ??????? ????????? ????
        # ? ???????? ?????????? ???????? ?? ????????? ?? ???????????
        # ? ?????? ? ??????????? ????????? ???????
        self.create_id_foto(self.image, self.drawable, shelf['format'], auto_levels)
        if data == 'auto_execute':
          # ?????? ???????
          self.image.scale(self.mm_in_px(shelf['format']['width'], shelf['format']['resolution']), self.mm_in_px(shelf['format']['height'], shelf['format']['resolution']))
          if self.data['formats'][self.format_radio.index(format_id)]['angle']:
            self.angle(self.image, self.drawable, self.data['formats'][self.format_radio.index(format_id)]['angle'])
          if self.data['formats'][self.format_radio.index(format_id)]['oval']:
            self.oval(self.image, self.drawable)
          if self.data['formats'][self.format_radio.index(format_id)]['to_grayscale']:
            self.to_grayscale(self.image, self.drawable)
          if self.data['formats'][self.format_radio.index(format_id)]['gray_frame']:
            self.gray_frame(self.image)
          copys = self.data['formats'][self.format_radio.index(format_id)]['copys']
          paper = self.data['formats'][self.format_radio.index(format_id)]['paper']
          print_photo = self.data['formats'][self.format_radio.index(format_id)]['print_photo']
          self.print_functon(self.image, self.drawable, paper, copys, print_photo)
        break
    # ????????? ???????????? ?? ???????
    gimp.displays_flush()
    # ????????? ?????? ?????????? UNDO
    self.image.undo_group_end()
    gimp.context_pop()
    gtk.main_quit()

  # ??? ??????? ?????? ????????? ???????? ?????????
  # ? ??? ??????? ??????????? ?? ????????? ??????? ???? ??????????
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号