浏览代码

Remove hardcoded tz

tags/v1.1
Nico Rey 4 年前
父节点
当前提交
81a7fd7b3d
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. +4
    -1
      install.sh
  2. +2
    -2
      sun.py

+ 4
- 1
install.sh 查看文件

@@ -202,10 +202,13 @@ read -rp "Enter your latitude (South values are negative): "
read -rp "Enter your longitude (West values are negative): "
lon=$REPLY

read -rp "Enter your timezone (Ex: -3 for Argentina time): "
timezone=$REPLY

sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.noaa.conf"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.wxtoimgrc"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/$(echo "$lon * -1" | bc)/g" "$HOME/.predict/predict.qth"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "sun.py"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g;s/change_tz/$(echo "$timezone * -1" | bc)/g" "sun.py"

# Running WXTOIMG to have the user accept the licensing agreement
wxtoimg


+ 2
- 2
sun.py 查看文件

@@ -2,8 +2,8 @@
import ephem
import time
import sys
date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])+3*60*60))
timezone = change_tz
date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])+(timezone*60*60)))

obs=ephem.Observer()
obs.lat='change_latitude'


正在加载...
取消
保存