CinnamonDesktop.WallClock

g CinnamonDesktop.WallClock CinnamonDesktop.WallClock GObject.Object GObject.Object GObject.Object->CinnamonDesktop.WallClock

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

lctime_format (gettext_domain, format_string)

class

new ()

get_clock ()

get_clock_for_format (format_string)

get_default_date_format ()

get_default_time_format ()

set_format_string (format_string)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

clock

str

r

format-string

str

r/w

The string to format the clock to

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_object

GObject.Object

r

Class Details

class CinnamonDesktop.WallClock(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

CinnamonDesktop.WallClockClass

classmethod lctime_format(gettext_domain, format_string)
Parameters:
Returns:

The translated format string.

Return type:

str

Returns the translation of the format string according to the LC_TIME locale.

classmethod new()
Returns:

A pointer to a new CinnamonDesktop.WallClock instance.

Return type:

CinnamonDesktop.WallClock

Returns a new CinnamonDesktop.WallClock instance

get_clock()
Returns:

The formatted date/time string.

Return type:

str

Returns a formatted date and time based on either default format settings, or via a custom-set format string.

The returned string should be ready to be set on a label.

get_clock_for_format(format_string)
Parameters:

format_string (str) –

Returns:

The formatted date/time string, or None if there was a problem with the format string.

Return type:

str

Returns a formatted date and time based on the provided format string. The returned string should be ready to be set on a label.

get_default_date_format()
Returns:

The default date format string.

Return type:

str

Returns the current date-only format based on current locale defaults and clock settings.

get_default_time_format()
Returns:

The default time format string.

Return type:

str

Returns the current time-only format based on current locale defaults and clock settings.

set_format_string(format_string)
Parameters:

format_string (str or None) –

Returns:

Whether or not the format string was valid and accepted.

Return type:

bool

Sets the wall clock to use the provided format string for any subsequent updates. Passing None will un-set any custom format, and rely on a default locale format.

Any invalid format string passed will cause it to be ignored, and the default locale format used instead.

Property Details

CinnamonDesktop.WallClock.props.clock
Name:

clock

Type:

str

Default Value:

None

Flags:

READABLE

A formatted string representing the current clock display.

CinnamonDesktop.WallClock.props.format_string
Name:

format-string

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

If not None, the wall clock will format the time/date according to this format string. If the format string is invalid, the default string will be used instead.