Browse Source

remove python-dateutil dependency

Fabian Peter Hammerle 5 years ago
parent
commit
14c6988f12
2 changed files with 4 additions and 4 deletions
  1. 1 1
      README.md
  2. 3 3
      rc.xsh

+ 1 - 1
README.md

@@ -5,6 +5,6 @@ http://xon.sh/envvars.html
 ## Installation
 
 ```{sh}
-pip3 install --user xonsh python-dateutil xontrib-z
+pip3 install --user xonsh xontrib-z
 git clone git@git.hammerle.me:fphammerle/config-xonsh.git $HOME/.config/xonsh
 ```

+ 3 - 3
rc.xsh

@@ -27,7 +27,6 @@ $PROMPT = ''.join([
 $RIGHT_PROMPT = '{gitstatus}{env_name: {}}'
 
 import datetime as dt
-import dateutil.tz
 import os
 import re
 import shutil
@@ -53,8 +52,9 @@ def locate(*patterns, match_all=True, ignore_case=True):
     return $(locate @(params) -- @(patterns)).split('\n')[:-1]
 
 def timestamp_iso():
-    return dt.datetime.now(tz=dateutil.tz.tzlocal()) \
-            .strftime('%Y%m%dT%H%M%S%z')
+    # if called without tz argument astimezone() assumes
+    # the system local timezone for the target timezone
+    return dt.datetime.now().astimezone().strftime('%Y%m%dT%H%M%S%z')
 
 aliases['g'] = ['git']
 aliases['ll'] = ['ls', '-l', '--all', '--indicator-style=slash',