diff --git a/AUTHORS b/AUTHORS index 7b062b0..a2aaa67 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1 @@ -Copyright (C) YYYY +Copyright (C) 2013 Sean Davis diff --git a/bin/mugshot b/bin/mugshot index e5646f6..4396fb9 100755 --- a/bin/mugshot +++ b/bin/mugshot @@ -1,7 +1,18 @@ #!/usr/bin/python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ### DO NOT EDIT THIS FILE ### diff --git a/data/ui/AboutMugshotDialog.ui b/data/ui/AboutMugshotDialog.ui index d168d5d..3f3e70f 100644 --- a/data/ui/AboutMugshotDialog.ui +++ b/data/ui/AboutMugshotDialog.ui @@ -1,14 +1,25 @@ - - False + # Copyright (C) 2013 Sean Davis <smd.seandavis@gmail.com> +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +Copyright (C) 2013 Sean Davis <smd.seandavis@gmail.com>False 5 ../media/mugshot.svg normal Mugshot - + Copyright (C) 2013 Sean Davis <smd.seandavis@gmail.com> ../media/mugshot.svg @@ -35,4 +46,4 @@ - + \ No newline at end of file diff --git a/data/ui/MugshotWindow.ui b/data/ui/MugshotWindow.ui index ba8894a..e58fbde 100644 --- a/data/ui/MugshotWindow.ui +++ b/data/ui/MugshotWindow.ui @@ -3,225 +3,340 @@ + + True + False + 16 + insert-image + True False - gtk-help + 16 + camera-photo + + + True + False + 16 + document-open + + + True + False + + + + Select from stock... + True + False + image1 + False + + + + + + Capture from camera... + True + False + False + image2 + False + + + + + Browse... + True + False + image3 + False + + + + + + + + + + + False Mugshot + False ../media/mugshot.svg - + True False - 5 + 12 + vertical - + True False + 12 - + + 128 + 128 True - False - False - _File - True - - + True + True + half + + + True False - - - gtk-new - True - False - False - True - True - - - - - - gtk-open - True - False - False - True - True - - - - - - True - False - - - - - gtk-save - True - False - False - True - True - - - - - - gtk-save-as - True - False - False - True - True - - - - - - True - False - - - - - gtk-close - True - False - False - True - True - - - + 128 + avatar-default + + False + False + 0 + - + True False - False - _Edit - True - - + vertical + 6 + + True False + 6 - - gtk-cut + True False - False - True - True - + 0 + none + + + True + False + 2 + + + True + True + + name + + + + + + + True + False + <b>First Name</b> + True + + + + True + True + 0 + - - gtk-copy + True False - False - True - True - + 0 + none + + + True + False + 2 + + + True + True + + name + + + + + + + True + False + <b>Last Name</b> + True + + + + True + True + 1 + - - gtk-paste + True False - False - True - True - - - - - - gtk-delete - True - False - False - True - True - - - - - - True - False - - - - - gtk-preferences - True - False - False - True - True + 0 + none + + + True + False + 2 + + + True + True + 4 + + 4 + alpha + + + + + + + True + False + <b>Initials</b> + True + + + + False + True + 2 + + + False + True + 0 + - - - - - True - False - False - _View - True - - - - - True - False - False - _Help - True - - + + True False + 6 - - Contents + True False - False - image2 - False - + 0 + none + + + True + False + 2 + + + True + True + + phone + + + + + + + True + False + <b>Home Phone</b> + True + + + + True + True + 0 + - - gtk-about + True False - False - True - True + 0 + none + + + True + False + 2 + + + True + True + + phone + + + + + + + True + False + <b>Office Phone</b> + True + + + + True + True + 1 + + + False + True + 1 + + + + + Show Office Details + True + False + True + True + + + False + True + end + 2 + + + True + True + 2 + @@ -231,57 +346,58 @@ - - True - False - 30 - 5 - Your application has been created! - -To start changing this user interface, run 'quickly design', which will open Glade so you can edit the default windows and dialogs. - -To change the behavior and edit the python code, run 'quickly edit', which will bring up a text editor. - True - - - True - True - 1 - + - + True False - 5 - 5 - ../media/background.png - - - True - True - 15 - 2 - - - - - True - False - 2 + 12 + 6 + end - + + gtk-help True - False - 0 - 5 - 5 - Status Area + True + True + True - True + False True 0 + True + + + + + gtk-cancel + True + True + True + True + + + + False + True + 1 + + + + + gtk-apply + True + True + True + True + + + + False + True + 2 @@ -289,7 +405,265 @@ To change the behavior and edit the python code, run 'quickly edit', which will False True end - 3 + 2 + + + + + + + False + 5 + True + center-always + dialog + True + mugshot_window + + + False + vertical + 2 + + + False + 12 + end + + + gtk-cancel + True + False + True + True + + + False + True + 0 + + + + + gtk-ok + True + False + True + True + + + False + True + 1 + + + + + False + True + end + 0 + + + + + True + False + 6 + 18 + 12 + + + 48 + 48 + True + False + 0 + 0 + 48 + password + + + 0 + 0 + 1 + 2 + + + + + True + False + 0 + <big><b>Enter your password to change user details.</b></big> + True + + + 1 + 0 + 2 + 1 + + + + + True + False + 0 + This is a security measure to prevent unwanted updates +to your personal information. + + + 1 + 1 + 2 + 1 + + + + + True + False + 12 + Password: + + + 1 + 2 + 1 + 1 + + + + + True + True + True + 12 + True + False + + password + + + 2 + 2 + 1 + 1 + + + + + True + False + + + + + + 0 + 2 + 1 + 1 + + + + + True + True + 1 + + + + + + button1 + button2 + + + + False + Stock Browser + True + center-on-parent + 600 + 480 + True + dialog + mugshot_window + + + + True + False + 12 + vertical + 12 + + + True + False + in + + + True + True + liststore1 + + + + 1 + + + + + + + True + True + 0 + + + + + True + False + + + gtk-cancel + True + True + False + True + + + + False + True + 0 + + + + + gtk-ok + True + True + True + True + + + + False + True + 1 + + + + + False + True + end + 1 diff --git a/mugshot/AboutMugshotDialog.py b/mugshot/AboutMugshotDialog.py index 5653f92..5ef2d6a 100644 --- a/mugshot/AboutMugshotDialog.py +++ b/mugshot/AboutMugshotDialog.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE from locale import gettext as _ diff --git a/mugshot/MugshotWindow.py b/mugshot/MugshotWindow.py index 98a5f3a..c7d36a5 100644 --- a/mugshot/MugshotWindow.py +++ b/mugshot/MugshotWindow.py @@ -1,11 +1,27 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE from locale import gettext as _ -from gi.repository import Gtk # pylint: disable=E0611 +import os +import pexpect +import shutil +import subprocess + +from gi.repository import Gtk, Gdk, GdkPixbuf # pylint: disable=E0611 import logging logger = logging.getLogger('mugshot') @@ -13,6 +29,24 @@ from mugshot_lib import Window from mugshot.AboutMugshotDialog import AboutMugshotDialog from mugshot.PreferencesMugshotDialog import PreferencesMugshotDialog +def which(command): + '''Use the system command which to get the absolute path for the given + command.''' + return subprocess.Popen(['which', command], stdout=subprocess.PIPE).stdout.read().strip() + +def detach_cb(menu, widget): + '''Detach a widget from its attached widget.''' + menu.detach() + +def menu_position(self, menu, data=None, something_else=None): + '''Position a menu at the bottom of its attached widget''' + widget = menu.get_attach_widget() + allocation = widget.get_allocation() + window_pos = widget.get_window().get_position() + x = window_pos[0] + allocation.x + y = window_pos[1] + allocation.y + allocation.height + return (x, y, True) + # See mugshot_lib.Window.py for more details about how this class works class MugshotWindow(Window): __gtype_name__ = "MugshotWindow" @@ -23,6 +57,214 @@ class MugshotWindow(Window): self.AboutDialog = AboutMugshotDialog self.PreferencesDialog = PreferencesMugshotDialog + + self.updated_image = None + + self.first_name_entry = builder.get_object('first_name') + self.last_name_entry = builder.get_object('last_name') + self.initials_entry = builder.get_object('initials') + self.office_phone_entry = builder.get_object('office_phone') + self.home_phone_entry = builder.get_object('home_phone') + self.user_image = builder.get_object('user_image') + self.image_button = builder.get_object('image_button') + self.image_menu = builder.get_object('image_menu') + self.image_menu.attach_to_widget(self.image_button, detach_cb) + self.iconview = builder.get_object('stock_iconview') + self.stock_browser = builder.get_object('stock_browser') + + face = os.path.expanduser('~/.face') + if os.path.isfile(face): + self.set_user_image(face) + else: + self.set_user_image(None) # Code for other initialization actions should be added here. + self.first_name, self.last_name, self.initials, self.office_phone, \ + self.home_phone = self.get_user_details() + if self.home_phone == 'none': self.home_phone = '' + if self.office_phone == 'none': self.office_phone = '' + self.first_name_entry.set_text(self.first_name) + self.last_name_entry.set_text(self.last_name) + self.initials_entry.set_text(self.initials) + self.office_phone_entry.set_text(self.office_phone) + self.home_phone_entry.set_text(self.home_phone) + + def on_image_from_browse_activate(self, widget): + chooser = Gtk.FileChooserDialog(_("Select an image"), self, Gtk.FileChooserAction.OPEN, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.OK)) + image_filter = Gtk.FileFilter() + image_filter.set_name('Images') + image_filter.add_mime_type('image/*') + chooser.add_filter(image_filter) + response = chooser.run() + if response == Gtk.ResponseType.OK: + self.updated_image = chooser.get_filename() + self.set_user_image(self.updated_image) + chooser.hide() + + def on_stock_browser_delete_event(self, widget, event): + widget.hide() + return True + + def on_image_from_stock_activate(self, widget): + self.load_stock_browser() + self.stock_browser.show_all() + + def on_image_button_clicked(self, widget): + """When the menu button is clicked, display the appmenu.""" + if widget.get_active(): + self.image_menu.popup(None, None, menu_position, + self.image_menu, 3, + Gtk.get_current_event_time()) + + def on_cancel_button_clicked(self, widget): + self.destroy() + + def on_image_menu_hide(self, widget): + self.image_button.set_active(False) + + def get_finger_details_updated(self): + if self.first_name != self.first_name_entry.get_text().strip() or \ + self.last_name != self.last_name_entry.get_text().strip() or \ + self.home_phone != self.home_phone_entry.get_text().strip() or \ + self.office_phone != self.office_phone_entry.get_text().strip(): + return True + return False + + def on_apply_button_clicked(self, widget): + if self.get_finger_details_updated(): + self.save_finger() + if self.updated_image: + self.save_image() + + def set_user_image(self, filename=None): + if filename: + pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename) + scaled = pixbuf.scale_simple(128, 128, GdkPixbuf.InterpType.HYPER) + self.user_image.set_from_pixbuf(scaled) + else: + self.user_image.set_from_icon_name('avatar-default', 128) + + def load_stock_browser(self): + model = self.iconview.get_model() + if len(model) != 0: + return + for filename in os.listdir('/usr/share/pixmaps/faces'): + full_path = os.path.join('/usr/share/pixmaps/faces/', filename) + if os.path.isfile(full_path): + pixbuf = GdkPixbuf.Pixbuf.new_from_file(full_path) + scaled = pixbuf.scale_simple(90, 90, GdkPixbuf.InterpType.HYPER) + model.append([full_path, scaled]) + + def on_stock_cancel_clicked(self, widget): + self.stock_browser.hide() + + def on_stock_ok_clicked(self, widget): + selected_items = self.iconview.get_selected_items() + if len(selected_items) != 0: + path = int(selected_items[0].to_string()) + filename = self.iconview.get_model()[path][0] + self.set_user_image(filename) + self.updated_image = filename + self.stock_browser.hide() + + + def get_user_details(self): + # Get user finger details from /etc/passwd + username = os.getenv('USER') + for line in open('/etc/passwd', 'r'): + if line.startswith(username + ':'): + details = line.split(':')[4] + name, office, office_phone, home_phone = details.split(',', 3) + try: + first_name, last_name = name.split(' ', 1) + initials = first_name[0] + last_name[0] + except: + first_name = name + last_name = '' + initials = first_name[0] + return first_name, last_name, initials, office_phone, home_phone + + def get_password(self): + # Show a password dialog to get password. + dialog = self.builder.get_object('password_dialog') + entry = self.builder.get_object('password_entry') + response = dialog.run() + dialog.hide() + if response == Gtk.ResponseType.OK: + pw = entry.get_text() + entry.set_text('') + return pw + return None + + def get_entry_value(self, entry_widget): + # Get the text from an entry, changing none to '' + value = entry_widget.get_text().strip() + if value.lower() == 'none': + value = '' + return value + + def save_finger(self): + return_codes = [] + + # Get the user's password + password = self.get_password() + if not password: + return return_codes + + username = os.getenv('USER') + chfn = which('chfn') + + # Get each of the updated values. + first_name = self.get_entry_value(self.first_name_entry) + last_name = self.get_entry_value(self.last_name_entry) + full_name = "%s %s" % (first_name, last_name) + full_name = full_name.strip() + office_phone = self.get_entry_value(self.office_phone_entry) + if office_phone == '': + office_phone = 'none' + home_phone = self.get_entry_value(self.home_phone_entry) + if home_phone == '': + home_phone = 'none' + + # Full name can only be modified by root. Try using sudo to modify. + child = pexpect.spawn('sudo %s %s' % (chfn, username)) + child.timeout = 5 + try: + child.expect([".*ssword.*", pexpect.EOF]) + child.sendline(password) + child.expect("Full Name.*:") + child.sendline(full_name) + for i in range(5): + child.sendline('') + except pexpect.TIMEOUT: + # Password was incorrect, or sudo rights not granted + pass + child.close() + return_codes.append(child.exitstatus) + + child = pexpect.spawn('chfn') + child.expect('Password: ') + child.sendline(password) + child.expect('Room Number.*:') + child.sendline('') + child.expect('Work Phone.*:') + child.sendline(office_phone) + child.expect('Home Phone.*:') + child.sendline(home_phone) + child.sendline(home_phone) + child.close(True) + return_codes.append(child.exitstatus) + return return_codes + + def save_image(self): + # Copy the updated image to .face + if not self.updated_image: + return False + face = os.path.expanduser('~/.face') + if os.path.isfile(face): + os.remove(face) + shutil.copyfile(self.updated_image, face) + self.updated_image = None + return True + diff --git a/mugshot/PreferencesMugshotDialog.py b/mugshot/PreferencesMugshotDialog.py index 93e2559..e116d2e 100644 --- a/mugshot/PreferencesMugshotDialog.py +++ b/mugshot/PreferencesMugshotDialog.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE # This is your preferences dialog. diff --git a/mugshot/__init__.py b/mugshot/__init__.py index 24013e2..92f9969 100644 --- a/mugshot/__init__.py +++ b/mugshot/__init__.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE import optparse diff --git a/mugshot_lib/AboutDialog.py b/mugshot_lib/AboutDialog.py index cdd8646..0cb879d 100644 --- a/mugshot_lib/AboutDialog.py +++ b/mugshot_lib/AboutDialog.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ### DO NOT EDIT THIS FILE ### diff --git a/mugshot_lib/Builder.py b/mugshot_lib/Builder.py index 87ace17..3c3f461 100644 --- a/mugshot_lib/Builder.py +++ b/mugshot_lib/Builder.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ### DO NOT EDIT THIS FILE ### diff --git a/mugshot_lib/PreferencesDialog.py b/mugshot_lib/PreferencesDialog.py index 9eedb7f..e5da5bc 100644 --- a/mugshot_lib/PreferencesDialog.py +++ b/mugshot_lib/PreferencesDialog.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ### DO NOT EDIT THIS FILE ### diff --git a/mugshot_lib/Window.py b/mugshot_lib/Window.py index 46f9bd9..f21be44 100644 --- a/mugshot_lib/Window.py +++ b/mugshot_lib/Window.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ### DO NOT EDIT THIS FILE ### diff --git a/mugshot_lib/__init__.py b/mugshot_lib/__init__.py index 00a6cea..bc3d9e7 100644 --- a/mugshot_lib/__init__.py +++ b/mugshot_lib/__init__.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ### DO NOT EDIT THIS FILE ### diff --git a/mugshot_lib/helpers.py b/mugshot_lib/helpers.py index 34d1259..15ca93f 100644 --- a/mugshot_lib/helpers.py +++ b/mugshot_lib/helpers.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ### DO NOT EDIT THIS FILE ### diff --git a/mugshot_lib/mugshotconfig.py b/mugshot_lib/mugshotconfig.py index 9f47761..423d2ff 100644 --- a/mugshot_lib/mugshotconfig.py +++ b/mugshot_lib/mugshotconfig.py @@ -1,6 +1,17 @@ # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ### DO NOT EDIT THIS FILE ### @@ -14,7 +25,7 @@ __all__ = [ # Where your project will look for your data (for instance, images and ui # files). By default, this is ../data, relative your trunk layout __mugshot_data_directory__ = '../data/' -__license__ = '' +__license__ = 'GPL-3' __version__ = 'VERSION' import os diff --git a/setup.py b/setup.py index e2f4b22..3c1a964 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,18 @@ #!/usr/bin/env python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE ###################### DO NOT TOUCH THIS (HEAD TO THE SECOND PART) ###################### @@ -126,7 +137,7 @@ class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto): DistUtilsExtra.auto.setup( name='mugshot', version='0.1', - #license='GPL-3', + license='GPL-3', #author='Your Name', #author_email='email@ubuntu.com', #description='UI for managing …', diff --git a/tests/test_example.py b/tests/test_example.py index 2560f47..390fe5f 100644 --- a/tests/test_example.py +++ b/tests/test_example.py @@ -1,7 +1,18 @@ #!/usr/bin/python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE import sys diff --git a/tests/test_lint.py b/tests/test_lint.py index 5d59a3e..1d4859b 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -1,7 +1,18 @@ #!/usr/bin/python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE -# This file is in the public domain +# Copyright (C) 2013 Sean Davis +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranties of +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . ### END LICENSE import unittest