Compare commits
10 commits
6636cbff81
...
f235a4cdae
Author | SHA1 | Date | |
---|---|---|---|
f235a4cdae | |||
232a7fe51a | |||
1e64259a09 | |||
0164d236e8 | |||
b26615eaa1 | |||
63e84e940e | |||
c54421cf55 | |||
773eaa4350 | |||
02c0a2d325 | |||
50451b3676 |
10 changed files with 82 additions and 19 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
|||
*~
|
||||
__pycache__
|
||||
/build
|
||||
/dist
|
||||
/MANIFEST
|
||||
|
|
2
MANIFEST.in
Normal file
2
MANIFEST.in
Normal file
|
@ -0,0 +1,2 @@
|
|||
include etc/pylock.conf
|
||||
include po/POTFILES.in po/pylock.pot po/*.po
|
8
po/POTFILES.in
Normal file
8
po/POTFILES.in
Normal file
|
@ -0,0 +1,8 @@
|
|||
[encoding: UTF-8]
|
||||
pylock/__init__.py
|
||||
pylock/Main.py
|
||||
pylock/Locker.py
|
||||
pylock/Selection.py
|
||||
pylock/pam.py
|
||||
pylock/LockWindow.py
|
||||
[type: gettext/glade]pylock/data/unlock.ui
|
14
po/de.po
14
po/de.po
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: pylock 0.1\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-04-12 16:37+0200\n"
|
||||
"POT-Creation-Date: 2013-04-16 10:35+0200\n"
|
||||
"PO-Revision-Date: 2012-02-01 19:30+0100\n"
|
||||
"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n"
|
||||
"Language-Team: German <de@li.org>\n"
|
||||
|
@ -16,11 +16,11 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ../pylock/LockWindow.py:119
|
||||
#: ../pylock/LockWindow.py:123
|
||||
msgid "This computer is currently locked by the user <i>{username}</i>."
|
||||
msgstr "Dieser Computer ist zur Zeit vom Benutzer <i>{username}</i> gesperrt."
|
||||
|
||||
#: ../pylock/LockWindow.py:123
|
||||
#: ../pylock/LockWindow.py:127
|
||||
msgid ""
|
||||
"This computer is currently locked by the user <i>{username}</i>.\n"
|
||||
"The user can be logged out in {minutes:02}:{seconds:02} minutes."
|
||||
|
@ -28,7 +28,7 @@ msgstr ""
|
|||
"Dieser Computer ist zur Zeit vom Benutzer <i>{username}</i> gesperrt.\n"
|
||||
"Der Benutzer kann in {minutes:02}:{seconds:02} Minuten ausgeloggt werden."
|
||||
|
||||
#: ../pylock/LockWindow.py:128
|
||||
#: ../pylock/LockWindow.py:132
|
||||
msgid ""
|
||||
"This computer is currently locked by the user <i>{username}</i>.\n"
|
||||
"The user can be logged out now."
|
||||
|
@ -36,14 +36,14 @@ msgstr ""
|
|||
"Dieser Computer ist zur Zeit vom Benutzer <i>{username}</i> gesperrt.\n"
|
||||
"Der Benutzer kann jetzt ausgeloggt werden."
|
||||
|
||||
#: ../unlock.ui.h:1
|
||||
#: ../pylock/data/unlock.ui.h:1
|
||||
msgid "Password:"
|
||||
msgstr "Passwort:"
|
||||
|
||||
#: ../unlock.ui.h:2
|
||||
#: ../pylock/data/unlock.ui.h:2
|
||||
msgid "Unlock"
|
||||
msgstr "Entsperren"
|
||||
|
||||
#: ../unlock.ui.h:3
|
||||
#: ../pylock/data/unlock.ui.h:3
|
||||
msgid "Logout"
|
||||
msgstr "Ausloggen"
|
||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-04-12 18:43+0200\n"
|
||||
"POT-Creation-Date: 2013-04-16 10:35+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
10
pylock.py
Executable file
10
pylock.py
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
|
||||
from pylock import Main
|
||||
|
||||
Main.main()
|
|
@ -58,7 +58,7 @@ class Locker(object):
|
|||
if self.currentLogoutTimeout > 0:
|
||||
GLib.timeout_add_seconds(1, self._checkLogout)
|
||||
|
||||
return True
|
||||
return False
|
||||
|
||||
def unlock(self):
|
||||
if self.locked:
|
||||
|
|
|
@ -64,7 +64,7 @@ def main():
|
|||
locale.textdomain('pylock')
|
||||
|
||||
if 'theme' in config:
|
||||
Gtk.Settings.get_defalt().set_property('gtk-theme-name', config['theme'])
|
||||
Gtk.Settings.get_default().set_property('gtk-theme-name', config['theme'])
|
||||
|
||||
def waitForSelection():
|
||||
if Selection.get() != 0:
|
||||
|
|
59
setup.py
59
setup.py
|
@ -1,29 +1,70 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import distutils
|
||||
import DistUtilsExtra.auto
|
||||
import distutils.core
|
||||
import distutils.command.build
|
||||
import distutils.command.install
|
||||
import glob
|
||||
import os
|
||||
|
||||
|
||||
class build_pylock(distutils.command.build.build):
|
||||
def run(self):
|
||||
distutils.command.build.build.run(self)
|
||||
|
||||
data_files = self.distribution.data_files
|
||||
if data_files is None:
|
||||
# in case not data_files are defined in setup.py
|
||||
self.distribution.data_files = data_files = []
|
||||
|
||||
for po_file in glob.glob("po/*.po"):
|
||||
lang = os.path.basename(po_file[:-3])
|
||||
mo_dir = os.path.join("build", "mo", lang, "LC_MESSAGES")
|
||||
mo_file = os.path.join(mo_dir, "%s.mo" % self.distribution.metadata.name)
|
||||
if not os.path.exists(mo_dir):
|
||||
os.makedirs(mo_dir)
|
||||
cmd = ["msgfmt", po_file, "-o", mo_file]
|
||||
po_mtime = os.path.getmtime(po_file)
|
||||
mo_mtime = os.path.exists(mo_file) and os.path.getmtime(mo_file) or 0
|
||||
if po_mtime > mo_mtime:
|
||||
self.spawn(cmd)
|
||||
|
||||
targetpath = os.path.join("share/locale", lang, "LC_MESSAGES")
|
||||
data_files.append((targetpath, (mo_file,)))
|
||||
|
||||
class install_pylock(distutils.command.install.install):
|
||||
def run(self):
|
||||
distutils.dir_util.copy_tree('etc', os.path.join(self.root, '/etc'),
|
||||
preserve_times=0, preserve_symlinks=1, verbose=1)
|
||||
|
||||
distutils.command.install.install.run(self)
|
||||
|
||||
DistUtilsExtra.auto.setup(
|
||||
name = 'pylock',
|
||||
version = '1',
|
||||
distutils.dir_util.copy_tree('etc', os.path.join(self.root, 'etc'),
|
||||
preserve_times=0, preserve_symlinks=1, verbose=1)
|
||||
|
||||
data_files = [],
|
||||
distutils.core.setup(
|
||||
name = 'pylock',
|
||||
version = '3',
|
||||
author = 'Matthias Schiffer',
|
||||
author_email = 'mschiffer@universe-factory.net',
|
||||
url = 'http://git.universe-factory.net/pylock/',
|
||||
description = 'A lightweight screenlocker for X implemented in Python 3 using Gtk3',
|
||||
license = 'BSD',
|
||||
|
||||
packages = ['pylock'],
|
||||
package_data = {
|
||||
'pylock': ['data/unlock.ui', 'data/bg.svg'],
|
||||
},
|
||||
|
||||
scripts = ['scripts/pylock'],
|
||||
|
||||
cmdclass = {
|
||||
'build': build_pylock,
|
||||
'install': install_pylock,
|
||||
},
|
||||
|
||||
provides = ['pylock'],
|
||||
requires = [
|
||||
'gi.repository.Gtk',
|
||||
'gi.repository.Gdk',
|
||||
'gi.repository.GdkX11',
|
||||
'gi.repository.GObject',
|
||||
'gi.repository.GLib',
|
||||
],
|
||||
)
|
||||
|
|
Reference in a new issue