~asier-iturralde/electoralcalculator/trunk

« back to all changes in this revision

Viewing changes to partyEditor.py

  • Committer: Asier Iturralde Sarasola
  • Date: 2012-06-10 17:47:51 UTC
  • Revision ID: asier.iturralde@gmail.com-20120610174751-4dix0f1agbjf1rx3
Refactor all files except calculations_doctest.py to follow PEP8

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*-
3
3
 
4
 
# Copyright 2012 Asier Iturralde Sarasola 
 
4
# Copyright 2012 Asier Iturralde Sarasola
5
5
#
6
6
# This file is part of Electoral Calculator.
7
7
#
25
25
class partyEditor():
26
26
 
27
27
    def __init__(self, party, votes, function, treeIter):
28
 
        
 
28
 
29
29
        # The function used to update the values of the liststore
30
30
        # tvwCandidatures from the main window (ElectoralCalculator.py)
31
31
        self.setTreeElement = function
32
 
        
 
32
 
33
33
        # The tree iterator that points to the currently selected item
34
34
        # in the liststore tvwCandidatures from the main window
35
35
        # (ElectoralCalculator.py)
37
37
 
38
38
        # Create new GtkBuilder object
39
39
        self.builder = Gtk.Builder()
40
 
        
 
40
 
41
41
        # Load UI from file
42
42
        self.builder.add_from_file("partyEditor.glade")
43
 
        
 
43
 
44
44
        # Connect signal
45
45
        self.builder.connect_signals(self)
46
 
        
 
46
 
47
47
        # Get the info window pointer from UI
48
48
        self.partyEditor = self.builder.get_object("partyEditor")
49
 
        
 
49
 
50
50
        # Connect the delete event to the function delete_event
51
51
        # to destroy the partyEditor window
52
52
        self.partyEditor.connect('delete-event', self.delete_event)
53
 
        
 
53
 
54
54
        # Get txtVotes from the UI
55
55
        self.txtParty = self.builder.get_object("txtParty")
56
56