Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/add_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from gi.repository import Gtk, Gdk
import pickle
import os
from gbi_common import password_strength

# Directory use from the installer.
Expand All @@ -26,7 +27,10 @@ def save_selection(self):
name = self.name.get_text()
up = self.password.get_text()
shell = self.sh
hf = '/home/%s' % self.user.get_text()
if os.path.isdir('/Users'):
hf = '/Users/%s' % self.user.get_text()
else:
hf = '/home/%s' % self.user.get_text()
hst = self.host.get_text()
ul = [uname, name, up, shell, hf]

Expand Down Expand Up @@ -86,7 +90,11 @@ def __init__(self, button3):
self.repassword.connect("changed", self.password_verification, button3)
self.label5 = Gtk.Label("Shell")
shell = Gtk.ComboBoxText()
self.sh = '/usr/local/bin/fish'
try:
open('/Users')
self.sh = '/usr/local/bin/zsh'
except:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Use except Exception: rather than bare except: (do-not-use-bare-except)

Suggested change
except:
except Exception:

self.sh = '/usr/local/bin/fish'
shell.append_text('sh')
shell.append_text('csh')
shell.append_text('tcsh')
Expand All @@ -95,7 +103,6 @@ def __init__(self, button3):
shell.append_text('rbash')
shell.append_text('ksh')
shell.append_text('zsh')
shell.set_active(3)
shell.connect("changed", self.on_shell)
label = Gtk.Label('<b>Set Hostname</b>')
label.set_use_markup(True)
Expand Down