Skip to content

Commit

Permalink
Porting changes from FoldingAtHome#56
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaik authored and ffissore committed Apr 30, 2020
1 parent 39bb260 commit d8bf395
Show file tree
Hide file tree
Showing 5 changed files with 7,088 additions and 8 deletions.
2 changes: 1 addition & 1 deletion fah/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self, app, name, address, port, password):

# Option names
names = list(app.client_option_widgets.keys())
self.option_names = [name.replace('_', '-') for name in names]
self.option_names = list(map(lambda name: name.replace('_', '-'), names))
self.option_names.append('power') # Folding power

# Init commands
Expand Down
8 changes: 4 additions & 4 deletions fah/ClientConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ def update_info(self, app):
category = category[1:]

# Frame
#frame = Gtk.Frame('<b>%s</b>' % name)
frame = Gtk.Frame()
frame.name = name
frame = Gtk.Frame.new('<b>%s</b>' % name)
frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
vbox.pack_start(frame, False, True, 0)
frame.set_label_align(0.01, 0.5)
frame.get_label_widget().set_use_markup(True)
vbox.pack_start(frame, False, False, 0)

# Alignment
align = Gtk.Alignment.new(0, 0, 1, 1)
Expand Down
6 changes: 3 additions & 3 deletions fah/Connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def open(self):
self.last_connect = time.time()

self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.setblocking(0)
self.socket.setblocking(False)
ready = select.select([self.socket], [self.socket], [], 10)
if ready[0]:
err = self.socket.connect_ex((self.address, self.port))
Expand Down Expand Up @@ -164,7 +164,7 @@ def read_some(self):
# Error codes for nothing to read
if err.errno not in [errno.EAGAIN, errno.EWOULDBLOCK, WSAEWOULDBLOCK]:
if bytesRead: return bytesRead
self.connection_error(err, err.strerror)
self.connection_error(err.errno, err.strerror)
raise

return bytesRead
Expand All @@ -190,7 +190,7 @@ def write_some(self):
# Error codes for write buffer full
if err.errno not in [errno.EAGAIN, errno.EWOULDBLOCK, WSAEWOULDBLOCK]:
if bytesWritten: return bytesWritten
self.connection_error(err, err.strerror)
self.connection_error(err.errno, err.strerror)
raise

return bytesWritten
Expand Down
Loading

0 comments on commit d8bf395

Please sign in to comment.