Skip to content

Commit

Permalink
weather@mockturtl Update 2.4.5 (linuxmint#2893)
Browse files Browse the repository at this point in the history
* Add yahoo-bridge and its requirements

* Change maximum number of daily forecasts to 7 from 5

* Add option to use custom icon set in popup menu

* Center sunrise/sunset times horizontally

* Switch Climaicons out to Weather-icons

* Fully switched to weather-icons, added licence

* Add Beaufort scale as a wind speed unit, add some more comments

* Use icons for displaying surise and sunset

* Add option to display temperature Russian style, update pot file

* Increment version

* Fix regression that space was missing from temperatures and temperature units

* Add version to changelog

* Center forecast data when there are more then 1 line of summary and style to be more compact.

* Change styling and add more declarations

* Add known issue

* Factor out config and Main loop to their own class

* Fix bulkiness with Mint-Y themes

* Refactor icon_type

* Factored Popupmenu ui UI out of applet

* Reorganise code

* Fix regression when changing icon type for applet

* Fix issue where forecasts does not have bottom padding on earlier versions of Cinnamon.

* Fix issue where forecast does not have enough bottom padding with vertical layout.

* Minor styling, update readme and changelog

* Update CHANGELOG.md

* Fix typos in changelog

* Add missing plan

* Fix issues Codacy raised

* Chaneg yahoo string variables for Codacity (not like it makes a difference...)
  • Loading branch information
brownsr committed Mar 5, 2020
1 parent 2c52c71 commit 8eb7653
Show file tree
Hide file tree
Showing 327 changed files with 7,526 additions and 6,573 deletions.
13 changes: 13 additions & 0 deletions weather@mockturtl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 2.4.5

* Fixes [#618](https://github.com/linuxmint/cinnamon-spices-applets/issues/618)
* Fixes [#2885](https://github.com/linuxmint/cinnamon-spices-applets/issues/2885)
* Fixes [#2890](https://github.com/linuxmint/cinnamon-spices-applets/issues/2890)
* Center Sunrise and Sunset Label, and use icons instead of text.
* Use weather-icons from [Erik Flowers](https://github.com/erikflowers/weather-icons) instead of Climaicons as it has more icons for conditions.
* Add Python-JS Yahoo bridge, preparation to add Yahoo back as an option.
* Add option to use the Custom icon set in the popup menu, not just on the panel.
* Maximum number of forecasts displayed increased from 5 to 7.
* Code refactor in preparation for adding Hourly forecasts on middle click (Config, Main Loop and PopupMenu has its own class now)
* Amend styling to be more consistent across themes

# 2.4.4

* Fixes [#2782](https://github.com/linuxmint/cinnamon-spices-applets/issues/2872)
Expand Down
7 changes: 7 additions & 0 deletions weather@mockturtl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@ Right-click to access `cinnamon-settings` -> _Applets -> Configure_.

[Mailing list](http:https://groups.google.com/group/cinnamon-weather)

## Future Plans

* Add Yahoo weather as a weather provider option
* Add some kind of hourly forecast on middle click
* Switch to MET Norway API v2.0 when it comes out (has a better iconnaming scheme for conditions)

## Known Issues

* Sunset/Sunrise is not displayed correctly if there is a mismatch between the Location Timezone and System Timezone when using Manual Location
* DarkSky verbose conditions are only in cm/celsius or in/fahrenheit
* Location button does not indicate that its hovered over with light themes.

### Troubleshooting

Expand Down
947 changes: 516 additions & 431 deletions weather@mockturtl/files/weather@mockturtl/3.0/applet.js

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions weather@mockturtl/files/weather@mockturtl/3.0/darkSky.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var DarkSky = (function () {
condition: {
main: this.GetShortCurrentSummary(json.currently.summary),
description: json.currently.summary,
icon: weatherIconSafely(this.ResolveIcon(json.currently.icon, { sunrise: sunrise, sunset: sunset }), this.app._icon_type),
icon: weatherIconSafely(this.ResolveIcon(json.currently.icon, { sunrise: sunrise, sunset: sunset }), this.app.config.IconType()),
customIcon: this.ResolveCustomIcon(json.currently.icon)
},
extra_field: {
Expand All @@ -141,7 +141,7 @@ var DarkSky = (function () {
},
forecasts: []
};
for (var i = 0; i < this.app._forecastDays; i++) {
for (var i = 0; i < this.app.config._forecastDays; i++) {
var day = json.daily.data[i];
var forecast = {
date: new Date(day.time * 1000),
Expand All @@ -150,7 +150,7 @@ var DarkSky = (function () {
condition: {
main: this.GetShortSummary(day.summary),
description: this.ProcessSummary(day.summary),
icon: weatherIconSafely(this.ResolveIcon(day.icon), this.app._icon_type),
icon: weatherIconSafely(this.ResolveIcon(day.icon), this.app.config.IconType()),
customIcon: this.ResolveCustomIcon(day.icon)
},
};
Expand All @@ -176,9 +176,9 @@ var DarkSky = (function () {
DarkSky.prototype.ConstructQuery = function () {
this.SetQueryUnit();
var query;
var key = this.app._apiKey.replace(" ", "");
var location = this.app._location.replace(" ", "");
if (this.app.noApiKey()) {
var key = this.app.config._apiKey.replace(" ", "");
var location = this.app.config._location.replace(" ", "");
if (this.app.config.noApiKey()) {
this.app.log.Error("DarkSky: No API Key given");
this.app.HandleError({
type: "hard",
Expand All @@ -192,7 +192,7 @@ var DarkSky = (function () {
query = this.query + key + "/" + location +
"?exclude=minutely,hourly,flags" + "&units=" + this.unit;
var locale = this.ConvertToAPILocale(this.app.currentLocale);
if (isLangSupported(locale, this.supportedLanguages) && this.app._translateCondition) {
if (isLangSupported(locale, this.supportedLanguages) && this.app.config._translateCondition) {
query = query + "&lang=" + locale;
}
return query;
Expand Down Expand Up @@ -311,34 +311,34 @@ var DarkSky = (function () {
DarkSky.prototype.ResolveCustomIcon = function (icon) {
switch (icon) {
case "rain":
return "Cloud-Rain";
return "rain-symbolic";
case "snow":
return "Cloud-Snow";
return "snow-symbolic";
case "fog":
return "Cloud-Fog";
return "fog-symbolic";
case "cloudy":
return "Cloud";
return "cloudy-symbolic";
case "partly-cloudy-night":
return "Cloud-Moon";
return "night-alt-cloudy-symbolic";
case "partly-cloudy-day":
return "Cloud-Sun";
return "day-cloudy-symbolic";
case "clear-night":
return "Moon";
return "night-clear-symbolic";
case "clear-day":
return "Sun";
return "day-sunny-symbolic";
case "storm":
return "Cloud-Lightning";
return "thunderstorm-symbolic";
case "showers":
return "Cloud-Drizzle";
return "showers-symbolic";
case "wind":
return "Wind";
return "strong-wind-symbolic";
default:
return "Cloud-Refresh";
return "cloud-refresh-symbolic";
}
};
DarkSky.prototype.SetQueryUnit = function () {
if (this.app._temperatureUnit == "celsius") {
if (this.app._windSpeedUnit == "kph" || this.app._windSpeedUnit == "m/s") {
if (this.app.config._temperatureUnit == "celsius") {
if (this.app.config._windSpeedUnit == "kph" || this.app.config._windSpeedUnit == "m/s") {
this.unit = 'si';
}
else {
Expand Down
2 changes: 1 addition & 1 deletion weather@mockturtl/files/weather@mockturtl/3.0/ipApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var IpApi = (function () {
mobile: json.mobile
};
this.app.log.Debug("Location obtained:" + json.lat + "," + json.lon);
this.app.log.Debug("Location setting is now: " + this.app._location);
this.app.log.Debug("Location setting is now: " + this.app.config._location);
return result;
}
catch (e) {
Expand Down
Loading

0 comments on commit 8eb7653

Please sign in to comment.