Skip to content

Commit

Permalink
README: replace python with python3
Browse files Browse the repository at this point in the history
  • Loading branch information
dreadnought committed Oct 31, 2016
1 parent a12e33b commit 6f93e9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README
Expand Up @@ -26,8 +26,8 @@ $ sudo apt-get install git python3 python3-gi gir1.2-gtk-3.0 \
gir1.2-osmgpsmap-1.0
$ git clone https://github.com/Kismon/kismon.git kismon
$ cd kismon
$ python setup.py build
# python setup.py install
$ python3 setup.py build
# python3 setup.py install

or just use

Expand Down
13 changes: 11 additions & 2 deletions kismon/widgets/networklist.py
Expand Up @@ -313,17 +313,26 @@ def on_locate_marker(self, widget):
self.locate_network_on_map(self.network_selected)

def on_copy_field(self, widget):
selected_text = self.network_lines[self.network_selected][self.column_selected]
selected_text = self.get_value_from_cell(self.network_selected, self.column_selected)
self.set_clipboard(selected_text)

def on_copy_network(self, widget):
text = []
num = 0
for column in self.columns:
text.append("%s: %s" % (column, self.network_lines[self.network_selected][num]))
value = self.get_value_from_cell(self.network_selected, num)
text.append("%s: %s" % (column, value))
num += 1
self.set_clipboard('\n'.join(text))

def set_clipboard(self, text):
self.clipboard.set_text("%s" % text, -1)
self.clipboard.store()

def get_value_from_cell(self, mac, column):
value = self.network_lines[mac][column]
try:
value = value.get_value()
except AttributeError:
pass
return value

0 comments on commit 6f93e9a

Please sign in to comment.