[Pymoul-svn] SF.net SVN: pymoul: [22] pymoul/trunk/src/moul
Status: Alpha
Brought to you by:
tiran
From: <ti...@us...> - 2007-01-15 15:15:28
|
Revision: 22 http://pymoul.svn.sourceforge.net/pymoul/?rev=22&view=rev Author: tiran Date: 2007-01-15 07:15:25 -0800 (Mon, 15 Jan 2007) Log Message: ----------- Added stub to handle D'ni time and Cavern time Added Paths: ----------- pymoul/trunk/src/moul/time/ pymoul/trunk/src/moul/time/README.txt pymoul/trunk/src/moul/time/__init__.py pymoul/trunk/src/moul/time/cavern.py pymoul/trunk/src/moul/time/dni.py Added: pymoul/trunk/src/moul/time/README.txt =================================================================== --- pymoul/trunk/src/moul/time/README.txt (rev 0) +++ pymoul/trunk/src/moul/time/README.txt 2007-01-15 15:15:25 UTC (rev 22) @@ -0,0 +1,30 @@ +Cavern time +----------- + +Cavern time is MDT (mountain time with daylight saving) + +D'ni time +--------- + +sources: + http://www.mystlore.com/wiki/D%27ni_time + http://www.mystlore.com/wiki/D%27ni_timekeeping_conversion_algorithms + +year 0: 7656 B.C. +hahrtee fahrah -> 625 hahr (100 pentovigesimal years) +hahr -> year +vai-lee (pl vai-lee-tee) -> month + hahr as 10 vai-lee-tee +yahr (pl yahr-tee) -> day with about 30h 14mins (1.26 earth days) + vai-lee has 29 yahr-tee +gahr-tah-vo-tee -> 6h 3mins (5 per yahr) +tah-vo-tee -> 14.5mins (25 per gahr-tah-vo) +gor-ahn-tee -> 36secs (25 per tah-vo) +pro-rahn-tee -> 1.5sec (25 per gor-ahn) + +The ten vaileetee are Leefo (April 21st to May 27th), Leebro (May 28th to July 3rd), Leesahn (July 3rd to August 8th), Leetar (August 9th and September 14th), Leevot (September 14th to October 20th), Leevofo (October 21st to November 26th), Leevobro (November 26th to January 1st), Leevosahn (January 2nd to February 7th), Leevotar (February 7th to March 15th) and Leenovoo (March 16th to April 21st). +New Year, traditionally a significant holiday, therefore occurs on April 21st in human terms: i.e., on Leefo 1. + +solar year: 365 days, 6 hours, 9 minutes and 9 seconds -> 31556925 seconds +D'ni hahr: 10×29×5×25×25×25 prorahntee -> 22656250 prorahntee +factor: 1.39285738 Added: pymoul/trunk/src/moul/time/__init__.py =================================================================== --- pymoul/trunk/src/moul/time/__init__.py (rev 0) +++ pymoul/trunk/src/moul/time/__init__.py 2007-01-15 15:15:25 UTC (rev 22) @@ -0,0 +1,8 @@ +# MOUL package +# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) + Added: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py (rev 0) +++ pymoul/trunk/src/moul/time/cavern.py 2007-01-15 15:15:25 UTC (rev 22) @@ -0,0 +1,35 @@ +# pyMoul - Python interface to Myst Online URU Live +# Copyright (C) 2007 Christian Heimes <christian (at) cheimes (dot) de> + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 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, write to the Free Software Foundation, Inc., 59 +# Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +"""pyMoul cavern time tool +""" +__all__ = ['TIMEZONE_NAMES',] + +from datetime import datetime +from datetime import timedelta + +from pytz import common_timezones +from pytz import timezone +from pytz import utc as UTC + +TIMEZONE_NAMES = common_timezones + +# Cyan HQ is near Spokane / Washington +# Cavern time is Mountain Time Zone (MDT) with daylight savings (MST) +CAVERN_TZ_NAME = 'US/Mountain' # MDT / MST +CAVERN_TZ = timezone(CAVERN_TZ_NAME) + Added: pymoul/trunk/src/moul/time/dni.py =================================================================== --- pymoul/trunk/src/moul/time/dni.py (rev 0) +++ pymoul/trunk/src/moul/time/dni.py 2007-01-15 15:15:25 UTC (rev 22) @@ -0,0 +1,55 @@ +# pyMoul - Python interface to Myst Online URU Live +# Copyright (C) 2007 Christian Heimes <christian (at) cheimes (dot) de> + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 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, write to the Free Software Foundation, Inc., 59 +# Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +"""pyMoul D'ni time tool +""" +from operator import mul + +FARAH_1 = -7656 # hahrtee fahrah 1 starts at April 21st 7656 B.C +DNI_FACTORS = ( + ('hahrtee fahrah', 625), + ('hahr', 10), + ('vai-lee', 29), + ('yahr', 5), + ('gahr-tah-vo', 25), + ('tah-vo', 25), + ('gor-ahn', 25), + ('pro-rahn', 1), + ) + +VAILATEE = ( + ('Leefo', ( 4, 21), ( 5, 27)), # 1: April 21st to May 27th + ('Leebro', ( 5, 28), ( 7, 3)), # 2: May 28th to July 3rd + ('Leesahn', ( 7, 3), ( 8, 8)), # 3: July 3rd to August 8th + ('Leetar', ( 8, 9), ( 9, 15)), # 4: August 9th and September 14th + ('Leevot', ( 9, 14), (10, 20)), # 5: September 14th to October 20th + ('Leevofo', (10, 21), (11, 26)), # 6: October 21st to November 26th + ('Leevobro', (11, 26), ( 1, 1)), # 7: November 26th to January 1st + ('Leevosahn', ( 1, 2), ( 2, 7)), # 8: January 2nd to February 7th + ('Leevotar', ( 2, 7), ( 3, 15)), # 9: February 7th to March 15th + ('Leenovoo', ( 3, 16), ( 4, 21)), # 10: March 16th to April 21st + ) +PRORAHN_PER_HAHR = reduce(mul, + [float(factor) for name, factor in DNI_FACTORS[1:-1]]) + +# Official SI year 365.25 days = 31.557.600 seconds +YEAR_SI = 31557600 +# Sidereal year: 365.256 363 051 days (365 d 6 h 9 min 9 s) +YEAR_SIDEREAL = (((((365 * 24) + 6 ) * 60 ) + 9 ) * 60 ) + 9 +YEAR = float(YEAR_SIDEREAL) + +FACTOR = YEAR / PRORAHN_PER_HAHR This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |