PyDate
PyDate is a very simple tool to adjust the system date and time conveniently
from an easy to use graphical interface.
It is primarily intended to be used with minimal desktop environments like IceWm which don't provide
such tools themselves.
KDE or Gnome libraries are not required to run PyDate.
Dependencies
PyDate requires the following packages to be installed:
- Python and Tkinter (tested with version 2.6.6 , probably any Python-2
version > 2.5 should be fine, however pydate will not work with the
new Python-3 series!)
- Tcl / Tk (tested with version 8.5.8 , anything >= 8.5 should be fine)
- iwidgets,
tested with v. 4.0.1
- the "date" utility from the coreutils package (which should be
installed anyway)
All of these should be included in any decent linux distribution, (though
some might be split into several packages).
Installation:
Generally there is no installation necessary, just unpack the tar.bz2
archive and execute the pydate.py file.
If you want to do a system-wide install, do (as root):
# cd source_directory/pydate-1.0 && ./install.sh
This will install the files to /usr/local .
After this you can start the program with the command "pydate".
Configuration:
There really is not much to configure.
A few (hopefully self-explanatory) options to customize the appearance
of the calendar widget and the Info/Help dialog can be edited directly
within pydate.py:
- FIRSTDAYOFWEEK = 'monday'
may be one of either 'sunday', 'monday', 'tuesday', 'wednesday',
'thursday', 'friday', 'saturday'
- WEEKDAYCOLOR = 'white'
WEEKENDCOLOR = 'mistyrose'
backgroundcolors for "Mon-Fri" and "Sat-Sun" respectively, may be
any named color accepted by Tk (see
here for a comprehensive
overview) or a hexadecimal color string of the form '#rrggbb',
as for example '#ffffff'
- INFOHEIGHT = 0
INFOWIDTH = 0
width and height of the "Info/Help" dialog window in pixels
(0 = "auto"); due to bugs in the iwidgets html viewer it may happen
that if the window's width is too small the layout of the tables
appears oddly broken; in this case you may try to increase the
window's width
Usage:
The program may be launched by any user, however in order to actually
set the system date and time of course root privilege is required.
The date can be adjusted through the calendar widget, either using the
mouse or through keyboard navigation.
When the calendar has keyboard focus, the following key bindings apply to the widget:
Arrow-left / D / + : select the next day
Arrow-right / Shift+D / - : " previous day
Arrow-up / M : " next month
Arrow-down / Shift+M : " previous month
Page-up / Y : " next year
Page-down / Shift+Y : " previous year
The time of day may either be adjusted with the mouse by moving
the clock's hands and selecting either "AM" or "PM".
Alternatively you can set the time in the time entry field:
Arrow-left / arrow-right / BackSpace : select the active field (hours,
minutes, seconds, am/pm)
Arrow-up / arrow-down / + / - : increase / decrease the value
in the currently selected field
0 - 9 : set the value in the currently
selected field
A / P : select am / pm
Global key bindings:
Ctrl+S : apply the selected date and time to
the system clock
Ctrl+Q : quit the program
F5 : update the calendar and clock widgets
to display the current system time
F1 : show info / help dialog window
Limitations:
PyDate allows to set the system time and date but
not to change
the timezone.
Handling timezones is rather complicated, because there is a
considerable amount of platform specific issues to be taken into account.
This is why I decided, for the sake of reliability, to not even try.
Bugs
There is an awkward design bug in the iwidgets Calendar widget:
by default every month -even February- has 31 days ;)
I added some tricky code to remove these excess days, however in some
cases (as for example Feb. 2014) the calendar layout shows empty space
then where a line of days (representing a week) was before the useless
days were removed, which makes the calendar look somewhat
"vertically compressed" in these cases.
This is purely a cosmetic issue though.
The iwidgets html viewer appears to be buggy, so on some systems the
layout of the info dialog might look more or less messed up.
News
Feb. 23 2013: PyDate-1.0
Initial reease.
Mar. 02 2013: PyDate-1.1
This release fixes a bug in the handling of keyboard events in the timefield entry that stopped
keyboard navigation from working on some systems (as it was reported on debian wheezy).
Download
PyDate is available for download on its
sourceforge site
License
PyDate is licensed under the terms of the
Gnu General Public License.
Contact
Any comments, bug reports and suggestions are highly welcome.
Please mailto:
Michael Lange <klappnase (at) users (dot) sourceforge (dot) net>
Hosted by: