Git Product home page Git Product logo

pyweather's People

Contributors

alexhurtado2000 avatar benjaminurquhart avatar gsilvapt avatar mat1g3r avatar o355 avatar theletterandrew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pyweather's Issues

Data type to catch: Wind direction Variable

Bugs bugs bugs. Here as a reminder, but right now, LA shows the wind direction as "Variable".

I'll add a catch to 0.6.1 beta code that will change the text to "Wind: x mph (x kph), blowing in variable directions".

Feature: Adding further enhancements to favorite locations

Description: Adding the ability to verify favorite locations, adding additional support for proper data gathering for new airport data, and adding support for airport locations.

Checklist:

  • Adding the additional extra data variables to option 1
  • Adding location validation checks for edited favorite locations & compatibility
  • Adding location validation checks for new favorite locations & compatibility
  • Adding compatibility for deleting favorite location
  • Doing testing & making sure the spinner works

Estimated completion: January 29, 2018

Use secure API endpoints by default

At this point we need to try and use secure APIs. PyWeather by default isn't using HTTPS.

EDIT: We will not test machines if they're HTTPS compatible or not, but instead catch if a SSL exception occurs.

Things to do:

  • Modify all URLs to enable SSL support
  • Modify all requests.get to make SSL work
  • Modify all other scripts to make SSL work

Unable to install geopy automatically on windows in IDLE.

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.

=============== RESTART: C:\Users\Benjamin\PyWeather\setup.py ===============
Your config likely isn't provisioned. Would you like to provision your config?
It's highly recommended you provision your config. If you decide not to,
you may run into issues using PyWeather.
Yes or No.
Input here: ywa
Couldn't understand your input. By default, I'm going to provision
your config. Beginning now...
Config file provisioned successfully! Moving on with PyWeather setup...
Welcome to PyWeather setup.
This is meant to run as a one-time program, when you first get PyWeather.

Running a few checks...

Before we get started, I want to confirm some permissions from you.
Is it okay if I use 1-5 MB of data (downloading libraries), save a small
text file called apikey.txt (> 2 KB), and automatically install Python
libraries?
Please input yes or no below:
Input here: yes

Cool! Let's start.
I'm going to start by checking for necessary libraries (to run PyWeather).
This can take a moment, so please hold tight while I check!
Deleting the PIP installer file (if it exists)
The file get-pip.py didn't exist, or we had wrong permissions.
All done!
Shucks. Not all necessary libraries are installed. Here's what needs to be installed:

  • Colorama
  • Geopy
  • appJar
  • Requests
    If you want me to, I can automatically install these libraries.
    Would you like me to do such? Yes or No.
    Input here: yes
    Now installing necessary libraries...
    Installing Colorama...
    Collecting colorama
    Downloading colorama-0.3.9-py2.py3-none-any.whl
    Installing collected packages: colorama
    Successfully installed colorama-0.3.9
    Installing geopy...
    Collecting geocoder
    Downloading geocoder-1.29.1-py2.py3-none-any.whl (82kB)

�[K 12% |### | 10kB 10.2MB/s eta 0:00:01
�[K 24% |####### | 20kB 525kB/s eta 0:00:01
�[K 37% |########### | 30kB 682kB/s eta 0:00:01
�[K 49% |############### | 40kB 772kB/s eta 0:00:01
�[K 62% |################### | 51kB 825kB/s eta 0:00:01
�[K 74% |####################### | 61kB 841kB/s eta 0:00:01
�[K 87% |########################### | 71kB 843kB/s eta 0:00:01
�[K 99% |############################### | 81kB 827kB/s eta 0:00:01
�[K 100% |################################| 92kB 708kB/s
Collecting requests (from geocoder)
Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)

�[K 11% |### | 10kB ...
�[K 23% |####### | 20kB 4.1MB/s eta 0:00:01
�[K 34% |########### | 30kB 2.8MB/s eta 0:00:01
�[K 46% |############## | 40kB 2.0MB/s eta 0:00:01
�[K 57% |################## | 51kB 1.7MB/s eta 0:00:01
�[K 69% |###################### | 61kB 1.5MB/s eta 0:00:01
�[K 80% |######################### | 71kB 1.3MB/s eta 0:00:01
�[K 92% |############################# | 81kB 1.2MB/s eta 0:00:01
�[K 100% |################################| 92kB 940kB/s
Collecting ratelim (from geocoder)
Downloading ratelim-0.1.6-py2.py3-none-any.whl
Collecting click (from geocoder)
Downloading click-6.7-py2.py3-none-any.whl (71kB)

�[K 14% |#### | 10kB ...
�[K 28% |######### | 20kB 5.1MB/s eta 0:00:01
�[K 43% |############# | 30kB 2.6MB/s eta 0:00:01
�[K 57% |################## | 40kB 2.0MB/s eta 0:00:01
�[K 71% |####################### | 51kB 1.7MB/s eta 0:00:01
�[K 86% |########################### | 61kB 1.5MB/s eta 0:00:01
�[K 100% |################################| 71kB 1.0MB/s
Collecting six (from geocoder)
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests->geocoder)
Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)

�[K 7% |## | 10kB ...
�[K 15% |#### | 20kB 5.1MB/s eta 0:00:01
�[K 23% |####### | 30kB 2.8MB/s eta 0:00:01
�[K 30% |######### | 40kB 2.0MB/s eta 0:00:01
�[K 38% |############ | 51kB 1.6MB/s eta 0:00:01
�[K 46% |############## | 61kB 1.4MB/s eta 0:00:01
�[K 54% |################# | 71kB 1.2MB/s eta 0:00:01
�[K 61% |################### | 81kB 1.1MB/s eta 0:00:01
�[K 69% |###################### | 92kB 1.1MB/s eta 0:00:01
�[K 77% |######################## | 102kB 994kB/s eta 0:00:01
�[K 85% |########################### | 112kB 839kB/s eta 0:00:01
�[K 92% |############################# | 122kB 736kB/s eta 0:00:01
�[K 100% |################################| 133kB 585kB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests->geocoder)
Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)

�[K 7% |## | 10kB 5.1MB/s eta 0:00:01
�[K 15% |#### | 20kB 3.4MB/s eta 0:00:01
�[K 23% |####### | 30kB 2.0MB/s eta 0:00:01
�[K 30% |######### | 40kB 1.7MB/s eta 0:00:01
�[K 38% |############ | 51kB 1.4MB/s eta 0:00:01
�[K 46% |############## | 61kB 1.3MB/s eta 0:00:01
�[K 53% |################# | 71kB 1.1MB/s eta 0:00:01
�[K 61% |################### | 81kB 1.0MB/s eta 0:00:01
�[K 69% |###################### | 92kB 940kB/s eta 0:00:01
�[K 76% |######################## | 102kB 906kB/s eta 0:00:01
�[K 84% |########################### | 112kB 781kB/s eta 0:00:01
�[K 92% |############################# | 122kB 691kB/s eta 0:00:01
�[K 99% |############################### | 133kB 632kB/s eta 0:00:01
�[K 100% |################################| 143kB 519kB/s
Collecting idna<2.7,>=2.5 (from requests->geocoder)
Downloading idna-2.6-py2.py3-none-any.whl (56kB)

�[K 18% |##### | 10kB ...
�[K 36% |########### | 20kB 5.1MB/s eta 0:00:01
�[K 54% |################# | 30kB 2.6MB/s eta 0:00:01
�[K 72% |####################### | 40kB 2.0MB/s eta 0:00:01
�[K 90% |############################# | 51kB 1.6MB/s eta 0:00:01
�[K 100% |################################| 61kB 1.0MB/s
Collecting certifi>=2017.4.17 (from requests->geocoder)
Downloading certifi-2017.7.27.1-py2.py3-none-any.whl (349kB)

�[K 2% | | 10kB 10.2MB/s eta 0:00:01
�[K 5% |# | 20kB 4.1MB/s eta 0:00:01
�[K 8% |## | 30kB 2.2MB/s eta 0:00:01
�[K 11% |### | 40kB 1.6MB/s eta 0:00:01
�[K 14% |#### | 51kB 1.3MB/s eta 0:00:01
�[K 17% |##### | 61kB 1.2MB/s eta 0:00:01
�[K 20% |###### | 71kB 1.1MB/s eta 0:00:01
�[K 23% |####### | 81kB 1.0MB/s eta 0:00:01
�[K 26% |######## | 92kB 930kB/s eta 0:00:01
�[K 29% |######### | 102kB 882kB/s eta 0:00:01
�[K 32% |########## | 112kB 752kB/s eta 0:00:01
�[K 35% |########### | 122kB 664kB/s eta 0:00:01
�[K 38% |############ | 133kB 609kB/s eta 0:00:01
�[K 41% |############# | 143kB 556kB/s eta 0:00:01
�[K 43% |############## | 153kB 514kB/s eta 0:00:01
�[K 46% |############## | 163kB 476kB/s eta 0:00:01
�[K 49% |############### | 174kB 447kB/s eta 0:00:01
�[K 52% |################ | 184kB 423kB/s eta 0:00:01
�[K 55% |################# | 194kB 399kB/s eta 0:00:01
�[K 58% |################## | 204kB 383kB/s eta 0:00:01
�[K 61% |################### | 215kB 364kB/s eta 0:00:01
�[K 64% |#################### | 225kB 344kB/s eta 0:00:01
�[K 67% |##################### | 235kB 328kB/s eta 0:00:01
�[K 70% |###################### | 245kB 313kB/s eta 0:00:01
�[K 73% |####################### | 256kB 293kB/s eta 0:00:01
�[K 76% |######################## | 266kB 279kB/s eta 0:00:01
�[K 79% |######################### | 276kB 265kB/s eta 0:00:01
�[K 82% |########################## | 286kB 252kB/s eta 0:00:01
�[K 84% |########################### | 296kB 240kB/s eta 0:00:01
�[K 87% |############################ | 307kB 230kB/s eta 0:00:01
�[K 90% |############################# | 317kB 220kB/s eta 0:00:01
�[K 93% |############################# | 327kB 212kB/s eta 0:00:01
�[K 96% |############################## | 337kB 204kB/s eta 0:00:01
�[K 99% |############################### | 348kB 198kB/s eta 0:00:01
�[K 100% |################################| 358kB 179kB/s
Collecting decorator (from ratelim->geocoder)
Downloading decorator-4.1.2-py2.py3-none-any.whl
Installing collected packages: urllib3, chardet, idna, certifi, requests, decorator, ratelim, click, six, geocoder
Successfully installed certifi-2017.7.27.1 chardet-3.0.4 click-6.7 decorator-4.1.2 geocoder-1.29.1 idna-2.6 ratelim-0.1.6 requests-2.18.4 six-1.10.0 urllib3-1.22
Installing appJar...
Collecting appJar
Downloading appJar-0.070.tar.gz (500kB)

�[K 2% | | 10kB ...
�[K 4% |# | 20kB 1.5MB/s eta 0:00:01
�[K 6% |# | 30kB 1.1MB/s eta 0:00:01
�[K 8% |## | 40kB 853kB/s eta 0:00:01
�[K 10% |### | 51kB 787kB/s eta 0:00:01
�[K 12% |### | 61kB 830kB/s eta 0:00:01
�[K 14% |#### | 71kB 770kB/s eta 0:00:01
�[K 16% |##### | 81kB 787kB/s eta 0:00:01
�[K 18% |##### | 92kB 737kB/s eta 0:00:01
�[K 20% |###### | 102kB 741kB/s eta 0:00:01
�[K 22% |####### | 112kB 635kB/s eta 0:00:01
�[K 24% |####### | 122kB 628kB/s eta 0:00:01
�[K 26% |######## | 133kB 609kB/s eta 0:00:01
�[K 28% |######### | 143kB 613kB/s eta 0:00:01
�[K 30% |######### | 153kB 595kB/s eta 0:00:01
�[K 32% |########## | 163kB 550kB/s eta 0:00:01
�[K 34% |########### | 174kB 541kB/s eta 0:00:01
�[K 36% |########### | 184kB 499kB/s eta 0:00:01
�[K 38% |############ | 194kB 494kB/s eta 0:00:01
�[K 40% |############# | 204kB 459kB/s eta 0:00:01
�[K 42% |############# | 215kB 461kB/s eta 0:00:01
�[K 45% |############## | 225kB 433kB/s eta 0:00:01
�[K 47% |############### | 235kB 419kB/s eta 0:00:01
�[K 49% |############### | 245kB 390kB/s eta 0:00:01
�[K 51% |################ | 256kB 370kB/s eta 0:00:01
�[K 53% |################# | 266kB 356kB/s eta 0:00:01
�[K 55% |################# | 276kB 335kB/s eta 0:00:01
�[K 57% |################## | 286kB 327kB/s eta 0:00:01
�[K 59% |################## | 296kB 309kB/s eta 0:00:01
�[K 61% |################### | 307kB 302kB/s eta 0:00:01
�[K 63% |#################### | 317kB 283kB/s eta 0:00:01
�[K 65% |#################### | 327kB 275kB/s eta 0:00:01
�[K 67% |##################### | 337kB 261kB/s eta 0:00:01
�[K 69% |###################### | 348kB 252kB/s eta 0:00:01
�[K 71% |###################### | 358kB 248kB/s eta 0:00:01
�[K 73% |####################### | 368kB 237kB/s eta 0:00:01
�[K 75% |######################## | 378kB 232kB/s eta 0:00:01
�[K 77% |######################## | 389kB 221kB/s eta 0:00:01
�[K 79% |######################### | 399kB 217kB/s eta 0:00:01
�[K 81% |########################## | 409kB 208kB/s eta 0:00:01
�[K 83% |########################## | 419kB 204kB/s eta 0:00:01
�[K 85% |########################### | 430kB 196kB/s eta 0:00:01
�[K 87% |############################ | 440kB 194kB/s eta 0:00:01
�[K 90% |############################ | 450kB 188kB/s eta 0:00:01
�[K 92% |############################# | 460kB 180kB/s eta 0:00:01
�[K 94% |############################## | 471kB 178kB/s eta 0:00:01
�[K 96% |############################## | 481kB 171kB/s eta 0:00:01
�[K 98% |############################### | 491kB 170kB/s eta 0:00:01
�[K 100% |################################| 501kB 149kB/s
�[31mException:
Traceback (most recent call last):
File "C:\Users\Benjamin\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Benjamin\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "C:\Users\Benjamin\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\Benjamin\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_set.py", line 634, in prepare_file
abstract_dist.prep_for_dist()
File "C:\Users\Benjamin\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "C:\Users\Benjamin\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "C:\Users\Benjamin\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\utils_init
.py", line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "C:\Users\Benjamin\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\compat_init_.py", line 73, in console_to_str
return s.decode(sys.stdout.encoding)
AttributeError: 'NoneType' object has no attribute 'encoding'�[0m
Installing requests...
Requirement already satisfied: requests in c:\users\benjamin\appdata\local\programs\python\python36\lib\site-packages
Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\users\benjamin\appdata\local\programs\python\python36\lib\site-packages (from requests)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\benjamin\appdata\local\programs\python\python36\lib\site-packages (from requests)
Requirement already satisfied: idna<2.7,>=2.5 in c:\users\benjamin\appdata\local\programs\python\python36\lib\site-packages (from requests)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\benjamin\appdata\local\programs\python\python36\lib\site-packages (from requests)
Sweet! All libraries should be installed.
Just to confirm, I'm double checking if needed libraries are installed.
Hmm...geopy didn't install properly.
As a last resort, we can use sudo -H to install packages.
Do you want to use the shell option to install geopy?
WARNING: Using the last-resort method may screw up PIP, and
may require you to reinstall PIP on your machine.Yes or No.
Input here: no
Not installing geopy with a shell command.
Cannot continue without geopy.
Press enter to exit.

Sudo is not available on Windows, so that won't work.

Bug: Hurricane data duplicate data

Wunderground (for some reason) tends to duplicate hurricane data. I submitted a ticket about this months ago but no response.

Because no one ever maintains their API, now I'm responsible for fixing it. It'll be fixed by storing the storm name in a dictionary that gets cleared every time you boot up hurricane data. When each storm is iterated over, the name is stored in the dictionary.

For every iteration we go into a for loop seeing if the hurricane name matches an entry in the dictionary. If it's a match, iterate on.

Checklist:

  • Code the fix
  • Complain to Wunderground (again)

Enhancement: Changing radar size on the fly

Description: Users can change the radar image size from inside the radar GUI through a settings window.

Checklist:

  • Adding the settings menu code
  • Adding the code to change the blank image & change URLs
  • Adding the code to clear the cache after a resolution change

Estimated completion time: January 29, 2017

Refactor configupdate.py

Completely refactoring configupdate.py using the "onion" method is something I'd like to do for 0.6.4 beta or 0.6.5 beta.

Instead of the current, redundant method, config changes would be applied based on which version you run on. Code snippet:

if version = 0.6.3 beta
config['FOO']['BAR'] = "2"
if version = 0.6.2 beta
config['FOO']['BAR'] = "1"

Along with this a new system for printing new config changes will also be implemented (2 lines, separated, input to view)

Lowering default data iterations

Lowering default data iterations in PyWeather for better readability. Before this gets started I will do a very conclusive study about how much data different terminals on different screens can render.

After that I'll decide on an iteration count that works well. Right now, the 5+ iteration method is only good for full-screen terminals.

To-do list:

  • Find the right amount of iterations per data type
  • Implement the new default values into all setup scripts (issue #85 is taking care of this)
  • Somehow find a way to ask the user if they'd like to lower default iterations when in configupdate.py.

Adding a much better system for config errors

Right now the system for showing errors for config errors sucks.

A new system would try each individual variable, and output to the user what config options are missing. This would also allow for multiple config errors to occur.

PyWeather 0.4 beta - MS_data is not defined when viewing detailed sun/moon data.

This error occurs when trying to view detailed sun/moon data in New York, NY.
Occurs 100% of the time (when reproduced twice)
OS is Kubuntu 16.10, Python 3.5.2 (yo Kubuntu, I hear you need an upgrade for yo Python, so...idk)

Output of the script:

Traceback (most recent call last):
File "pyweather.py", line 1021, in
if MS_data == True:
NameError: name 'MS_data' is not defined

A possible fix:
On Line 1014, in the try function, MS_data isn't getting defined. Since there is moonset data, the variable isn't getting defined.

This magically became the example issue

Bug: When quitting PyWeather on Linux, a TypeError occurs on close

Description: When I opened the GUI on my KDE neon laptop, everything worked, but on close this error occurred:

Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x7f19d9d90400>>
Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 3360, in __del__
TypeError: catching classes that do not inherit from BaseException is not allowed

I'll have to figure this out and see how to properly not display this (it's on close anyways)

Feature: Previous locations

Description: Adding previous locations (off by default) to automatically store the last 5 locations that were queried.

Things to determine: When querying a favorite location, do we store the favorite location variable OR do we store the location.

Checklist:

  • Adding initial support for previous locations (automatically storing them if the option is on), including data variables for airports as well
  • Adding the menu for deleting a certain previous location, or all.
  • Adding config options

Estimated completion time: January 12, 2017

Pushing enter on backup directory prompt crashes PyWeather

Where would you want me to backup the key to?
This is a directory. If I wanted my key at directory/backkey.txt,
You would enter 'directory'. The default directory is 'backup'.
Input here:

I pushed enter, expecting pyweather to automatically create and use the directory 'backup.'

Instead, I got this:
Creating a backup...
Couldn't make the directory, does it exist?
Traceback (most recent call last):
File "setup.py", line 846, in
open(folder_argument, 'w').close()
PermissionError: [Errno 13] Permission denied: '//backkey.txt'

I think the program should create the backup directory if no name is provided, something like:

def mkdir(directory):
if not os.path.exists(directory):
os.makedirs(directory)

Update check fail quits PyWeather without trying to get the weather.

So, I was looking through the code to fix the "rounding on termux" bug, and I noticed that when the update check fails, it doesn't go ahead and try to get the weather. Instead, it exits. I feel like it should at least try to get the weather before quitting (HINT HINT my project keeps going even when it fails :)

If the weather check fails, it should show the cached data as long as it isn't out of date (the data, not PyWeather.)

Anyway, that's what I think. I would do it myself, but I don't feel like it (OK OK I will :P)

Enhancing configsetup.py to add geocoder scheme detection

Configsetup.py needs to get enhanced to have geocoder detection code, but also allowing to maintain compatibility to launch without any additional libraries.

The new code would try to import geopy, and if it isn't found suggest installing geopy for functionality of the geocoder (at the end of the script). The user doesn't have to install geopy and can still default to an http scheme for the geocoder.

If the user already has geopy or wants to install it then we can run the geocoder scheme detection.

Adding a new updater system - Part 1

The PyWeather updater system sucks at the moment, and I'm going to change this in 0.6.4 beta.

Right now, the PyWeather updater uses Git to update, which has been notoriously unreliable across a half a dozen releases. Git only works on some platforms, and I'm sick of the updater breaking on each release.

Beginning with 0.6.3 beta, the Git updater will be entirely disabled, and I feel as if coding in a new updater will extend 0.6.3 beta's release time out too far into December 2017. A few configuration options will get removed as well.

From 0.6.3 beta to 0.6.4 beta, the .zip method will be the only way of downloading PyWeather within itself.

The new updater will encompass a few new tricks that I still need to learn, and here's how things will generally work:

  • The updater will check for new updates, and show to the user if they'd like to download the .zip, or update within PyWeather. The manual downloading of the .zip file will still be available.
  • If a user decides to run the automatic updater, the .zip will be unzipped in the base directory of PyWeather, replacing all files.
  • With the updated configupdate.py file, the script will run, and PyWeather will exit. Progress messages will get displayed throughout the process.

With this, I need to learn these skills:

  • Unzipping a .zip file properly with Python 3

Part 1 involves gutting the current git updater out of the 0.6.3 beta code, as I don't have the time to make the updater before the deadline of November 30 rolls around.

Termux glitch: No rounding on a lot of things

More bugs. I need to start rounding a lot of variables down to 1 or 2 places. Sad part, this is a large thing to do. Planning for a 0.6.1 beta release, but it could get pushed to 0.6.2.

Line 1498 in pyweather.py, "yesterday_hourlyLoops is not defined".

So I checked the previous day's weather in New York, using the hourly view. This error decided to show up:

File "pyweather.py", line 1498, in <module>
    if yesterday_totalloops == yesterday_hourlyLoops:
NameError: name 'yesterday_hourlyLoops' is not defined.

I'll fix this myself, I'd imagine it's fairly easy to do so, this issue was only made so that I can practice using issues since I rarely do so.

Adding a new updater system - Part 2

The PyWeather updater system sucks at the moment, and I'm going to change this in 0.6.4 beta.

Right now, the PyWeather updater uses Git to update, which has been notoriously unreliable across a half a dozen releases. Git only works on some platforms, and I'm sick of the updater breaking on each release.

Beginning with 0.6.3 beta, the Git updater will be entirely disabled, and I feel as if coding in a new updater will extend 0.6.3 beta's release time out too far into December 2017. A few configuration options will get removed as well.

From 0.6.3 beta to 0.6.4 beta, the .zip method will be the only way of downloading PyWeather within itself.

The new updater will encompass a few new tricks that I still need to learn, and here's how things will generally work:

  • The updater will check for new updates, and show to the user if they'd like to download the .zip, or update within PyWeather. The manual downloading of the .zip file will still be available.
  • If a user decides to run the automatic updater, the .zip will be unzipped in the base directory of PyWeather, replacing all files.
  • With the updated configupdate.py file, the script will run, and PyWeather will exit. Progress messages will get displayed throughout the process.

With this, I need to learn these skills:

  • Unzipping a .zip file properly with Python 3

Part 2 involves adding the actual updater code itself into 0.6.4 beta.

Checklist:

  • Creating v2 of the API
  • Figuring out how to download .zip files with a real progress bar (no spinny wheel)
  • Figuring out how to properly extract .zip files
  • Making a base updater UI to allow the user to check for updates (no downloading yet) and change to a different branch
  • Making the real "meat" of the updater
  • Adapting configupdate.py to accept RC packages
  • Redoing the update checker on boot

Enhancement: Adding historical data for PWSes

Description: Fixing historical weather code to allow PWSes to do historical lookups.

Checklist:

  • Adding code to fix historical weather code
  • Doing a mini-QA to see if everything is fixed

Estimated completion date: January 19, 2017

Text-based logo

This isn't really an issue more than an FYI

I made this beautiful work of art (still waiting for Wunderground to get back to me about using it):

logo.txt

0.3.3 bugs

Here are the list of bugs that need to get fixed in 0.3.3 (from extensive testing of 0.3.2):

  • Updating updater information (no der)
  • The current screen has a UI glitch for precip in the last hour (extra space)

'favoritelocation_available' is not defined

Hi! Thanks for your interest in contributing to PyWeather, by reporting an issue.

It's simply impossible for me to catch every bug in PyWeather, so you can help! Before you report an issue, run down this to-do list.

  • Make sure PyWeather is up-to-date. I do manage to catch a fair amount of bugs in PyWeather releases.
  • Make sure your issue isn't on the list of known issues. The page is available in the wiki, here.
  • Make sure you've properly set up PyWeather. Basically, this is running setup.py and going through all dialogs.
  • If your issue can be replicated, turn on tracebacks in the config file for the script it occurs in. To do this, head into your config file, and enable tracebacks on all options (from False to True). A traceback is extremely helpful in troubleshooting a bug!
  • You may report indev code, but you'll need to follow a few extra steps below:

Reporting indev code:

  • Do not, and I repeat, do not report issues about a config issue at start. Config issues are always tested during QA, so there's no need to report.
  • Please avoid reporting issues about code that isn't done. Let's take this example: I'm 100% done with feature 1, but 50% done with feature 2. If you found a bug in feature 1, report it! If you found a bug in feature 2, please don't report it until it's finished. You can check on the progress in the changelog, which is updated on a daily basis.

In the end, if you're unsure about the requirements above, report the issue anyways.

Done with the list? Here's what you'll need for a report.

  • The full traceback provided by Python, if applicable.
  • System information (OS, Python version). You can get your Python version by typing in python3 or python, and copying the first two lines outputted. For your OS, a description like Windows 10, or Ubuntu 16.04 works.
  • A description detailing the issue. Add as much detail as you can to your description, as the better the description, the faster I can find the bug.
  • If a bug is associated with a location, you'll want to generalize the location for your privacy. If you find a bug with weather data at 123 5th Avenue, New York, NY, try to generalize the location to New York, NY.

You can go the extra mile by adding this stuff to your report.

  • A screenshot of the bug. It's highly recommended to attach a screenshot of the bug if it deals with changing weather data.
  • Potential solutions. If you can do Python 3 coding, make a pull request, even if it's just one line of code!
  • Testing where the issue occurs. Sometimes bugs only occur on a certain OS.

More details on reporting an issue can be found in the .github folder, in the document called CONTRIBUTING.md. If you're still confused

If you'd like to keep this template in your report, that's completely fine. Otherwise, report the issue!

When attempting to load your configuration file, an error
occurred. This could of happened because of a typo, or an error
in the code. Make sure there aren't any typos in the config file,
and check the traceback below (report it to GitHub for extra internet
points).

Hello, I'm trying to figure out why this isn't working. Here is my traceback:

Traceback (most recent call last):
File "C:\Users\A Dizzle Fo Shizzle\AppData\Local\Programs\Python\Python36-32\lib\configparser.py", line 1138, in _unify_values
sectiondict = self._sections[section]
KeyError: 'FAVORITE LOCATIONS'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\A Dizzle Fo Shizzle\Documents\GitHub\PyWeather\pyweather.py", line 162, in
favoritelocation_enabled = config.getboolean('FAVORITE LOCATIONS', 'enabled')
File "C:\Users\A Dizzle Fo Shizzle\AppData\Local\Programs\Python\Python36-32\lib\configparser.py", line 829, in getboolean
raw=raw, vars=vars, fallback=fallback, **kwargs)
File "C:\Users\A Dizzle Fo Shizzle\AppData\Local\Programs\Python\Python36-32\lib\configparser.py", line 809, in _get_conv
**kwargs)
File "C:\Users\A Dizzle Fo Shizzle\AppData\Local\Programs\Python\Python36-32\lib\configparser.py", line 803, in _get
return conv(self.get(section, option, **kwargs))
File "C:\Users\A Dizzle Fo Shizzle\AppData\Local\Programs\Python\Python36-32\lib\configparser.py", line 781, in get
d = self._unify_values(section, vars)
File "C:\Users\A Dizzle Fo Shizzle\AppData\Local\Programs\Python\Python36-32\lib\configparser.py", line 1141, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: 'FAVORITE LOCATIONS'

  • Loading PyWeather...

\ Loading PyWeather...

  • Validating API key...

\ Validating API key...

| Validating API key...

/ Validating API key...

  • Validating API key...

  • Loading PyWeather...

\ Loading PyWeather...
Hey, welcome to PyWeather!
Below, enter a location to check the weather for that location!
Traceback (most recent call last):
File "C:\Users\A Dizzle Fo Shizzle\Documents\GitHub\PyWeather\pyweather.py", line 751, in
if favoritelocation_available is True:
NameError: name 'favoritelocation_available' is not defined
[Finished in 1.4s]

I'm running Windows 7 and Python 3.6.3.

Any other information you might need, please let me know. I checked the "Known Issues" like you said, and didn't see anything.

Faster access to different query types

Who wants to type favloc: or curloc:, amiright?

No one asked for it and you need MOAR speed to access these cool locations. fl:x will now be for favorite locations, cl for current location, pl:x for previous locations, ap:<code> for airports, and ps:<ID> for PWSes.

Checklist:

  • Add the input checking for all types
  • Make favorite locations compatible with these brand new query types
  • Make the pre-input code compatible with new query types

Bug: Extra tools dialogue bad exits

When extra tools is disabled and a user inputs no into the input (in my case I inputted yes and then no after a different input), the extra tools cache time menu appears.

Checklist:

  • Fix the bug
  • Test the bug

Issue with viewing historical "hourly" data - 0.5 beta

Quite an interesting one, but at least for one city (NY, on 1/1/2016), Wunderground reports the "hourly" data in 20 minute intervals. You can't get through the whole thing, as PyWeather cuts it short at 24 iterations.

There's also lots of UI fixes that need to occur.

Fix coming in 0.5.1 beta.

Google geocoder issues

Lots of Google geocoder issues, and at this point I've gotten tired of dealing with it. Here's a list of everything that can go wrong:

  • Geocoder failing at boot when it works the next time (even with an API key!)
  • Geocoder not properly detecting a scheme 100% of the time
  • Custom keys for HTTPS-only schemes

To help fix this issues:

  • At boot we REALLY make sure the geocode can get through. If the geocode fails initially, try again, and if it still fails, fall back to a geocoder with a public API key (HTTPS only)
  • Same deal with the Geocoder detection as above. Just keep trying.
  • Moving the custom key input after validation, and ONLY if we can run in HTTPS mode.

Oh the joys of APIs

Filesystem changes

Changes to the filesystem in 0.6.2 beta would include:

  • Radar placeholder and temporary gifs being put in a /radar folder
  • Documents (like the config readme, or other info) put into a /docs folder
  • Separate folder for the config file (/config)

Feature: Mars Weather

Description: Adding the weather on Mars via. a separate API. Current conditions will be available, historical data will NOT be available.

This can be added as a favorite location since the code will be outright separated.

Low priority: This is a low priority feature, and this feature will be dropped if this takes too long to implement (or at least keeping current conditions).

EDIT (1/4/18): The API that was supposed to be used went down, and it's been down for a day now. Scrapping this feature as it was a) low priority and b) I don't want this in PyWeather given how the API can go down for long periods of time.

I do realize APIs go down occasionally but they don't sporadically go down for nearly 24 hours.

Feature: Selecting a new radar location

In the latest version of appJar, you can now have a Google Map be displayed without the need for an API key. This new feature would allow users to select a new radar location, and if they wanted to set the radar location back to the location they looked up.

The location selection tool button would appear in the top right, and if a different location has been selected, a "Default location" button would appear.

Fixing the progress bar

Presently the progress bar in PyWeather is a complete mess. I've been looking around for a library that can support the variability that comes with booting PyWeather (some people might have 15 or 25 steps to boot).

I found a cool library called Halo on /r/coolgithubprojects, but it lacks Windows support at the moment.

Custom user agent feature

Adding the ability to set a custom user agent in the configuration file. Option will not be presented on set up.

New configuration options are as so:

[USERAGENT]
customagent_enabled = "False" (default)
customagent = "pyweather-0.6.2beta/apifetcher"

This will require changing all requests.get functions in PyWeather to be updated with a new argument.

KeyError: 'geoipservice_enabled'

I think you forgot to add something to the setup.py file...

----------------------------- BEGIN ERROR ----------------------------------
When attempting to load your configuration file, an error
occurred. This could of happened because of a typo, or an error
in the code. Make sure there aren't any typos in the config file,
and check the traceback below (report it to GitHub for extra internet
points).
Traceback (most recent call last):
File "/usr/lib/python3.5/configparser.py", line 786, in get
value = d[option]
File "/usr/lib/python3.5/collections/init.py", line 878, in getitem
return self.missing(key) # support subclasses that define missing
File "/usr/lib/python3.5/collections/init.py", line 870, in missing
raise KeyError(key)
KeyError: 'geoipservice_enabled'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/benjamin/Python/pyweather/pyweather.py", line 133, in
geoip_enabled = config.getboolean('UI', 'geoipservice_enabled')
File "/usr/lib/python3.5/configparser.py", line 826, in getboolean
raw=raw, vars=vars, fallback=fallback, **kwargs)
File "/usr/lib/python3.5/configparser.py", line 806, in _get_conv
**kwargs)
File "/usr/lib/python3.5/configparser.py", line 800, in _get
return conv(self.get(section, option, **kwargs))
File "/usr/lib/python3.5/configparser.py", line 789, in get
raise NoOptionError(option, section)
configparser.NoOptionError: No option 'geoipservice_enabled' in section: 'UI'
Hey, welcome to PyWeather!
Below, enter a location to check the weather for that location!
Traceback (most recent call last):
File "/home/benjamin/Python/pyweather/pyweather.py", line 485, in
if geoip_available is True:
NameError: name 'geoip_available' is not defined
--------------------------- END ERROR ----------------------------

0.6.0.1 setup bug: custom directory isn't allowed

On my phone, putting this here for later reference.

It's simply impossible for me to catch every bug in PyWeather, so you can help! Before you report an issue, run down this to-do list.

  • Make sure PyWeather is up-to-date. I do manage to catch a fair amount of bugs in PyWeather releases. - 0.6.0.1 beta
  • Make sure your issue isn't on the list of known issues. The page is available in the wiki, here. - isnt
  • Make sure you've properly set up PyWeather, so no import errors (unless I made a typo), etc. If you're unsure, report the issue anyways.
  • If your issue can be replicated, turn on tracebacks in the config file for the script it occurs in. If your issue occurs in the setup script, make setup_tracebacks true, and so on and so forth. Im the dev I know what happened

Done with the list? Here's what you'll need for a report.

  • The full traceback provided by the Python interpreter. - I know what happened
  • System information (OS version, Python version) - Ubuntu 16.04.2/Python 3.5
  • A description detailing the issue - can't let the backup key in your own directory

You can go the extra mile by adding this stuff to your report.

  • Potential solutions (if you know how to code Python, a PR is highly appreciated!) - gotta create a directory as the user specifies
  • Testing where the issue occurs (some bugs may be limited to certain OSes)
  • Anything else you think you should add to your report

If you'd like to keep this template in your report, that's completely fine. Otherwise, report the issue!

Bug should be fixed in 0.6.1 beta

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.