Exemple #1
0
 def show_monitor_channel(self):  #only for testing purpose
     """
     Show default channel in Channel Iconview when app starts.
     """
     monitor_data = channel_store.get_monitor_data()
     channel = Channel(monitor_data["monitor"])
     store = Channel_Store()
     store.get_default().add(channel.name, channel)
     (name, image_url, desc) = (channel.get_name(),
                                channel.get_thumbnail_url(),
                                channel.get_description())
     scaled_image = graphics_util.get_scaled_image(image_url, 180)
     for i in range(0, 1):
         self.app_window.icon_list_store.append([scaled_image, name, desc])
    def show_monitor_channel(self):#only for testing purpose

        """
        Show default channel in Channel Iconview when app starts.
        """
        monitor_data = channel_store.get_monitor_data()
        channel = Channel(monitor_data["monitor"])
        store = Channel_Store()
        store.get_default().add(channel.name,channel)
        (name,image_url,desc) = (channel.get_name()
                                ,channel.get_thumbnail_url()
                                ,channel.get_description())
        scaled_image = graphics_util.get_scaled_image(image_url,180)
        for i in range(0,1):
            self.app_window.icon_list_store.append([scaled_image,name,desc])
Exemple #3
0
    def export_sample_monitor(self):
        """
       Exports  a monitor channel runinng on local machine. For that first we
       get monitor channel configuration data from channel store.
       After that the monitor data is exported to file in JSON format using
       JSON Exporter and Channel Encoder.
       """

        ## Data to export
        exported_data = channel_store.get_monitor_data()

        ## monitor channel
        monitor_channel = Channel(exported_data["monitor"])

        ## path where channel data is exported.
        path = file_util.find_file(
            __file__, "../data/channels/to_import_sample_data.p2psp")

        ## JSON Exporter
        exporter = JSON_Exporter()
        exporter.to_JSON(path, {"monitor": monitor_channel}, Channel_Encoder)
    def export_sample_monitor(self):

       """
       Exports  a monitor channel runinng on local machine. For that first we
       get monitor channel configuration data from channel store.
       After that the monitor data is exported to file in JSON format using
       JSON Exporter and Channel Encoder.
       """

       ## Data to export
       exported_data = channel_store.get_monitor_data()

       ## monitor channel
       monitor_channel = Channel(exported_data["monitor"])

       ## path where channel data is exported.
       path = file_util.find_file(__file__,
                                   "../data/channels/to_import_sample_data.p2psp")

       ## JSON Exporter
       exporter  = JSON_Exporter()
       exporter.to_JSON(path,{"monitor":monitor_channel},Channel_Encoder)