##// END OF EJS Templates
timezone: fix issues with timezone detection of current logic....
marcink -
r2676:7fe5f77f default
parent child Browse files
Show More
@@ -1602,13 +1602,13 b''
1602 };
1602 };
1603 };
1603 };
1604 pytz = super.buildPythonPackage {
1604 pytz = super.buildPythonPackage {
1605 name = "pytz-2017.3";
1605 name = "pytz-2018.3";
1606 buildInputs = with self; [];
1606 buildInputs = with self; [];
1607 doCheck = false;
1607 doCheck = false;
1608 propagatedBuildInputs = with self; [];
1608 propagatedBuildInputs = with self; [];
1609 src = fetchurl {
1609 src = fetchurl {
1610 url = "https://pypi.python.org/packages/60/88/d3152c234da4b2a1f7a989f89609ea488225eaea015bc16fbde2b3fdfefa/pytz-2017.3.zip";
1610 url = "https://pypi.python.org/packages/1b/50/4cdc62fc0753595fc16c8f722a89740f487c6e5670c644eb8983946777be/pytz-2018.3.tar.gz";
1611 md5 = "7006b56c0d68a162d9fe57d4249c3171";
1611 md5 = "abb07c09c79f78d7c04f222a550c99ef";
1612 };
1612 };
1613 meta = {
1613 meta = {
1614 license = [ pkgs.lib.licenses.mit ];
1614 license = [ pkgs.lib.licenses.mit ];
@@ -1683,7 +1683,7 b''
1683 name = "rhodecode-enterprise-ce-4.12.0";
1683 name = "rhodecode-enterprise-ce-4.12.0";
1684 buildInputs = with self; [pytest py pytest-cov pytest-sugar pytest-runner pytest-catchlog pytest-profiling gprof2dot pytest-timeout mock WebTest cov-core coverage configobj];
1684 buildInputs = with self; [pytest py pytest-cov pytest-sugar pytest-runner pytest-catchlog pytest-profiling gprof2dot pytest-timeout mock WebTest cov-core coverage configobj];
1685 doCheck = true;
1685 doCheck = true;
1686 propagatedBuildInputs = with self; [setuptools-scm amqp authomatic Babel Beaker celery Chameleon channelstream click colander configobj cssselect decorator deform docutils dogpile.cache dogpile.core ecdsa FormEncode future futures gnureadline infrae.cache iso8601 itsdangerous Jinja2 billiard kombu lxml Mako Markdown MarkupSafe msgpack-python MySQL-python objgraph packaging Paste PasteDeploy PasteScript pathlib2 peppercorn psutil psycopg2 py-bcrypt pycrypto pycurl pyflakes pygments-markdown-lexer Pygments pyparsing pyramid-beaker pyramid-debugtoolbar pyramid-jinja2 pyramid-mako pyramid pysqlite python-dateutil python-ldap python-memcached python-pam pytz pyzmq py-gfm recaptcha-client redis repoze.lru requests Routes setproctitle simplejson six SQLAlchemy sshpubkeys subprocess32 supervisor Tempita translationstring trollius urllib3 URLObject venusian WebError WebHelpers2 WebHelpers WebOb Whoosh wsgiref zope.cachedescriptors zope.deprecation zope.event zope.interface nbconvert bleach nbformat jupyter-client alembic invoke bumpversion transifex-client gevent greenlet gunicorn waitress uWSGI ipdb ipython CProfileV bottle rhodecode-tools appenlight-client pytest py pytest-cov pytest-sugar pytest-runner pytest-catchlog pytest-profiling gprof2dot pytest-timeout mock WebTest cov-core coverage];
1686 propagatedBuildInputs = with self; [setuptools-scm amqp authomatic Babel Beaker celery Chameleon channelstream click colander configobj cssselect decorator deform docutils dogpile.cache dogpile.core ecdsa FormEncode future futures gnureadline infrae.cache iso8601 itsdangerous Jinja2 billiard kombu lxml Mako Markdown MarkupSafe msgpack-python MySQL-python objgraph packaging Paste PasteDeploy PasteScript pathlib2 peppercorn psutil psycopg2 py-bcrypt pycrypto pycurl pyflakes pygments-markdown-lexer Pygments pyparsing pyramid-beaker pyramid-debugtoolbar pyramid-jinja2 pyramid-mako pyramid pysqlite python-dateutil python-ldap python-memcached python-pam pytz tzlocal pyzmq py-gfm recaptcha-client redis repoze.lru requests Routes setproctitle simplejson six SQLAlchemy sshpubkeys subprocess32 supervisor Tempita translationstring trollius urllib3 URLObject venusian WebError WebHelpers2 WebHelpers WebOb Whoosh wsgiref zope.cachedescriptors zope.deprecation zope.event zope.interface nbconvert bleach nbformat jupyter-client alembic invoke bumpversion transifex-client gevent greenlet gunicorn waitress uWSGI ipdb ipython CProfileV bottle rhodecode-tools appenlight-client pytest py pytest-cov pytest-sugar pytest-runner pytest-catchlog pytest-profiling gprof2dot pytest-timeout mock WebTest cov-core coverage];
1687 src = ./.;
1687 src = ./.;
1688 meta = {
1688 meta = {
1689 license = [ { fullName = "Affero GNU General Public License v3 or later (AGPLv3+)"; } { fullName = "AGPLv3, and Commercial License"; } ];
1689 license = [ { fullName = "Affero GNU General Public License v3 or later (AGPLv3+)"; } { fullName = "AGPLv3, and Commercial License"; } ];
@@ -1910,6 +1910,19 b''
1910 license = [ pkgs.lib.licenses.asl20 ];
1910 license = [ pkgs.lib.licenses.asl20 ];
1911 };
1911 };
1912 };
1912 };
1913 tzlocal = super.buildPythonPackage {
1914 name = "tzlocal-1.5.1";
1915 buildInputs = with self; [];
1916 doCheck = false;
1917 propagatedBuildInputs = with self; [pytz];
1918 src = fetchurl {
1919 url = "https://pypi.python.org/packages/cb/89/e3687d3ed99bc882793f82634e9824e62499fdfdc4b1ae39e211c5b05017/tzlocal-1.5.1.tar.gz";
1920 md5 = "4553be891efa0812c4adfb0c6e818eec";
1921 };
1922 meta = {
1923 license = [ pkgs.lib.licenses.mit ];
1924 };
1925 };
1913 uWSGI = super.buildPythonPackage {
1926 uWSGI = super.buildPythonPackage {
1914 name = "uWSGI-2.0.15";
1927 name = "uWSGI-2.0.15";
1915 buildInputs = with self; [];
1928 buildInputs = with self; [];
@@ -61,7 +61,8 b' python-dateutil'
61 python-ldap==2.4.45
61 python-ldap==2.4.45
62 python-memcached==1.58
62 python-memcached==1.58
63 python-pam==1.8.2
63 python-pam==1.8.2
64 pytz==2017.3
64 pytz==2018.3
65 tzlocal==1.5.1
65 pyzmq==14.6.0
66 pyzmq==14.6.0
66 py-gfm==0.1.3
67 py-gfm==0.1.3
67 recaptcha-client==1.0.6
68 recaptcha-client==1.0.6
@@ -25,6 +25,7 b' Consists of functions to typically be us'
25 available to Controllers. This module is available to both as 'h'.
25 available to Controllers. This module is available to both as 'h'.
26 """
26 """
27
27
28 import os
28 import random
29 import random
29 import hashlib
30 import hashlib
30 import StringIO
31 import StringIO
@@ -742,18 +743,23 b' short_id = lambda x: x[:12]'
742 hide_credentials = lambda x: ''.join(credentials_filter(x))
743 hide_credentials = lambda x: ''.join(credentials_filter(x))
743
744
744
745
746 import pytz
747 import tzlocal
748 local_timezone = tzlocal.get_localzone()
749
750
745 def age_component(datetime_iso, value=None, time_is_local=False):
751 def age_component(datetime_iso, value=None, time_is_local=False):
746 title = value or format_date(datetime_iso)
752 title = value or format_date(datetime_iso)
747 tzinfo = '+00:00'
753 tzinfo = '+00:00'
748
754
749 # detect if we have a timezone info, otherwise, add it
755 # detect if we have a timezone info, otherwise, add it
750 if isinstance(datetime_iso, datetime) and not datetime_iso.tzinfo:
756 if time_is_local and isinstance(datetime_iso, datetime) and not datetime_iso.tzinfo:
751 if time_is_local:
757 force_timezone = os.environ.get('RC_TIMEZONE', '')
752 tzinfo = time.strftime("+%H:%M",
758 if force_timezone:
753 time.gmtime(
759 force_timezone = pytz.timezone(force_timezone)
754 (datetime.now() - datetime.utcnow()).seconds + 1
760 timezone = force_timezone or local_timezone
755 )
761 offset = timezone.localize(datetime_iso).strftime('%z')
756 )
762 tzinfo = '{}:{}'.format(offset[:-2], offset[-2:])
757
763
758 return literal(
764 return literal(
759 '<time class="timeago tooltip" '
765 '<time class="timeago tooltip" '
General Comments 0
You need to be logged in to leave comments. Login now