unity-api-bugs team mailing list archive
-
unity-api-bugs team
-
Mailing list archive
-
Message #04415
[Bug 1317971] [NEW] Can't disable/hide icon near label
Public bug reported:
I write openweathermap site appindicator in python, but i need only text
label in indicator without icon. But when i leave "" then show me empty
icon. Why, i need only text. In Ubuntu 12.04 python-appindicator don't
need a icon if leave "" then not load a empty icon, but in ubuntu 14.04
leave empty icon. How to disable the icon?? Any ideas?
** Affects: indicator-application
Importance: Undecided
Status: New
** Attachment added: "bug.png"
https://bugs.launchpad.net/bugs/1317971/+attachment/4108767/+files/bug.png
** Description changed:
I write openweathermap site appindicator in python, but i need only text
label in indicator without icon. But when i leave "" then show me empty
icon. Why, i need only text. In Ubuntu 12.04 python-appindicator don't
need a icon if leave "" then not load a empty icon, but in ubuntu 14.04
leave empty icon. How to disable the icon?? Any ideas?
-
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
-
- import sys
- import urllib2
- import json
- import time
- import datetime
-
- from gi.repository import Gtk, Gdk, GLib, GObject
- from gi.repository import AppIndicator3 as appindicator
-
- class programa:
-
- def __init__(self):
-
- self.ind = appindicator.Indicator.new("Weather","",appindicator.IndicatorCategory.APPLICATION_STATUS)
- self.ind.set_status(appindicator.IndicatorStatus.ACTIVE)
- self.menu_structure()
-
- def menu_structure(self):
- refresh = 720 # Sec
- url = urllib2.Request('http://api.openweathermap.org/data/2.5/weather?q=siauliai&units=metric')
- openup = urllib2.urlopen(url)
- json_string = openup.read()
- parsed_json = json.loads(json_string)
- temp = parsed_json['main']['temp']
- wind = parsed_json['wind']['speed']
- humidity = parsed_json['main']['humidity']
- clouds = parsed_json['clouds']['all']
- weather = parsed_json['weather'][0]['main']
- weather_desc = parsed_json['weather'][0]['description']
- update_time = parsed_json['dt']
- updated = datetime.datetime.fromtimestamp(int(update_time)).strftime('%H:%M')
-
- self.menu = Gtk.Menu()
- self.menu_updated = Gtk.MenuItem("Updatet: "+updated)
- self.menu_weather = Gtk.MenuItem("Weather: "+weather)
- self.menu_desc = Gtk.MenuItem("Desc: "+weather_desc)
- self.menu_clouds = Gtk.MenuItem("Clouds: "+str(clouds)+"%")
- self.menu_humidity = Gtk.MenuItem("Humidity: "+str(humidity)+"%")
- self.menu_wind = Gtk.MenuItem("Wind: "+str(wind)+" m/s")
- self.separator = Gtk.SeparatorMenuItem()
- self.exit = Gtk.MenuItem("Exit")
- self.exit.connect("activate", self.quit)
-
- self.menu_updated.show()
- self.menu_weather.show()
- self.menu_desc.show()
- self.menu_clouds.show()
- self.menu_humidity.show()
- self.menu_wind.show()
- self.separator.show()
- self.exit.show()
-
- self.menu.append(self.menu_updated)
- self.menu.append(self.menu_weather)
- self.menu.append(self.menu_desc)
- self.menu.append(self.menu_clouds)
- self.menu.append(self.menu_humidity)
- self.menu.append(self.menu_wind)
- self.menu.append(self.separator)
- self.menu.append(self.exit)
-
- self.ind.set_menu(self.menu)
- self.ind.set_label(str(temp)+u"\u2103".encode('utf-8'),"")
- openup.close()
- GLib.timeout_add_seconds(refresh,self.menu_structure)
-
- def quit(self, widget):
- sys.exit(0)
-
- if __name__ == "__main__":
- indicator = programa()
- Gtk.main()
--
You received this bug notification because you are a member of Unity API
bugs, which is subscribed to Application Indicators.
https://bugs.launchpad.net/bugs/1317971
Title:
Can't disable/hide icon near label
Status in Application Indicators:
New
Bug description:
I write openweathermap site appindicator in python, but i need only
text label in indicator without icon. But when i leave "" then show me
empty icon. Why, i need only text. In Ubuntu 12.04 python-appindicator
don't need a icon if leave "" then not load a empty icon, but in
ubuntu 14.04 leave empty icon. How to disable the icon?? Any ideas?
To manage notifications about this bug go to:
https://bugs.launchpad.net/indicator-application/+bug/1317971/+subscriptions
Follow ups
References