コード例 #1
0
 def compute_three(self):
     if self.root.focus_get() == self.entry_three:
         unit_one, unit_two, unit_three = convert(self.mode.get(), unit_three=self.unit_three.get())
         self.unit_one.set(unit_one)
         self.unit_two.set(unit_two)
         self.unit_three.set(unit_three)
コード例 #2
0
import convert_funcs
import data
import pickle


def output_data(filename, data):
    f = open(filename, 'w')
    for issue_data in data:
        f.write(issue_data.id + '\t' + issue_data.text + '\n')


if __name__ == '__main__':
    prs = data.PR.load_all()  # load all

    parsed_data = convert_funcs.convert(prs)

    output_data("data/input-se-issues.txt", parsed_data[convert_funcs.ISSUE])
    output_data("data/input-se-review.txt", parsed_data[convert_funcs.REVIEW])
    output_data("data/input-se-both.txt", parsed_data[convert_funcs.BOTH])

    parsed_data_file = open("data/parsed_data", 'wb+')
    pickle.dump(parsed_data, parsed_data_file)
コード例 #3
0
 def compute_one(self):                       # привязана к переменной в первой ячейки
     if self.root.focus_get() == self.entry_one:   #курсор на данном окне - иначе будут процесс изменения других переменных (будет конвертация)
         unit_one, unit_two, unit_three = convert(self.mode.get(), unit_one=self.unit_one.get()) # величины которые конвертируем в остальные два -
         self.unit_one.set(unit_one)          # после конвертации устанавливаем значение величины
         self.unit_two.set(unit_two)
         self.unit_three.set(unit_three)
コード例 #4
0
ファイル: main_test.py プロジェクト: IvanVasilev87/converter
 def compute_three(self):
     if self.root.focus_get() == self.entries[2]:
         unit_one, unit_two, unit_three = convert(self.mode.get(), unit_three=self.units[2].get())
         self.units[0].set(unit_one)          # после конвертации устанавливаем значение величины
         self.units[1].set(unit_two)
         self.units[2].set(unit_three)