FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-30-2012, 07:55 PM
Vratislav Podzimek
 
Default Proper months set

---
pyanaconda/ui/gui/spokes/datetime.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/datetime.py b/pyanaconda/ui/gui/spokes/datetime.py
index e7aa955..aed63f2 100644
--- a/pyanaconda/ui/gui/spokes/datetime.py
+++ b/pyanaconda/ui/gui/spokes/datetime.py
@@ -30,6 +30,7 @@ from pyanaconda.ui.gui.spokes import NormalSpoke
from pyanaconda.ui.gui.categories.localization import LocalizationCategory

from pyanaconda import localization
+import datetime

__all__ = ["DatetimeSpoke"]

@@ -61,8 +62,13 @@ class DatetimeSpoke(NormalSpoke):
for day in xrange(1, 32):
self.add_to_store(self._daysStore, day)

- for month in xrange(1, 13):
+ self._months_nums = dict()
+ for i in xrange(1, 13):
+ #a bit hacky way, but should return the translated string
+ #TODO: how to handle language change? Clear and populate again?
+ month = datetime.date(2000, i, 1).strftime('%B')
self.add_to_store(self._monthsStore, month)
+ self._months_nums[month] = i

for year in xrange(1990, 2051):
self.add_to_store(self._yearsStore, year)
--
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-02-2012, 03:13 PM
Vratislav Podzimek
 
Default Proper months set

---
pyanaconda/ui/gui/spokes/datetime_spoke.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index 353e9a1..598d488 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -30,6 +30,7 @@ from pyanaconda.ui.gui.spokes import NormalSpoke
from pyanaconda.ui.gui.categories.localization import LocalizationCategory

from pyanaconda import localization
+import datetime

__all__ = ["DatetimeSpoke"]

@@ -63,8 +64,13 @@ class DatetimeSpoke(NormalSpoke):
for day in xrange(1, 32):
self.add_to_store(self._daysStore, day)

- for month in xrange(1, 13):
+ self._months_nums = dict()
+ for i in xrange(1, 13):
+ #a bit hacky way, but should return the translated string
+ #TODO: how to handle language change? Clear and populate again?
+ month = datetime.date(2000, i, 1).strftime('%B')
self.add_to_store(self._monthsStore, month)
+ self._months_nums[month] = i

for year in xrange(1990, 2051):
self.add_to_store(self._yearsStore, year)
--
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-02-2012, 03:32 PM
Chris Lumens
 
Default Proper months set

> pyanaconda/ui/gui/spokes/datetime_spoke.py | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)

I think this could be merged with the previous patch too.

> @@ -63,8 +64,13 @@ class DatetimeSpoke(NormalSpoke):
> for day in xrange(1, 32):
> self.add_to_store(self._daysStore, day)
>
> - for month in xrange(1, 13):
> + self._months_nums = dict()
> + for i in xrange(1, 13):
> + #a bit hacky way, but should return the translated string
> + #TODO: how to handle language change? Clear and populate again?

I had some ideas on this, but they turned out to not quite be correct.
I will be looking at it more carefully when we have translations.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org