当前位置: 首页>>代码示例>>Python>>正文


Python progress.Progress方法代码示例

本文整理汇总了Python中progress.Progress方法的典型用法代码示例。如果您正苦于以下问题:Python progress.Progress方法的具体用法?Python progress.Progress怎么用?Python progress.Progress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在progress的用法示例。


在下文中一共展示了progress.Progress方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: refreshButtonClick

# 需要导入模块: import progress [as 别名]
# 或者: from progress import Progress [as 别名]
def refreshButtonClick(self):

        self.progress = Progress()
        self.progress(0.0,0.1)

        web = urllib2.urlopen("http://www.makehumancommunity.org/sites/default/files/assets.json");
        jsonstring = web.read()
        assetJson = json.loads(jsonstring)

        increment = 0.8 / len(assetJson.keys())
        current = 0.1

        log.debug("Finished downloading json file")

        for key in assetJson.keys():
            current = current + increment
            self.progress(current,current + increment)
            self.setupOneAsset(assetJson[key])

        with open(os.path.join(self.root,"assets.json"),"w") as f:
            f.write(jsonstring)

        self.loadAssetsFromJson(assetJson)

        self.progress(1.0) 
开发者ID:makehumancommunity,项目名称:community-plugins,代码行数:27,代码来源:assetdownload.py

示例2: create_adjacencies

# 需要导入模块: import progress [as 别名]
# 或者: from progress import Progress [as 别名]
def create_adjacencies(fregex, pool=None):
    adjacencies = set()
    addresses = set()
    files = glob(fregex)
    pb = Progress(len(files), 'Reading traceroutes', increment=1, callback=lambda: 'Adjacencies {:,d} Addresses {:,d}'.format(len(adjacencies), len(addresses)))
    if pool:
        p = create_cluster(pool)
        dv, lv = setup_parallel()
        with dv.sync_imports():
            import json
            import numpy
        dv['Popen'] = Popen
        dv['PIPE'] = PIPE
        dv['Warts'] = Warts
        dv['extract_trace'] = extract_trace
        dv['cycle_free'] = cycle_free
        results = lv.map_async(process_trace_file, files)
    else:
        results = map(process_trace_file, files)
    for new_adjacencies, new_addresses in pb.iterator(results):
        adjacencies.update(new_adjacencies)
        addresses.update(new_addresses)
    if pool:
        stop_cluster()
    return adjacencies, addresses 
开发者ID:alexmarder,项目名称:MAP-IT,代码行数:27,代码来源:mapit.py

示例3: __init__

# 需要导入模块: import progress [as 别名]
# 或者: from progress import Progress [as 别名]
def __init__(self, **kvargs):
        super(PDialog, self).__init__(**kvargs)

        self.box = BoxLayout(orientation='vertical')
        self.label_one = Label(text='', size_hint=(1, .1), markup=True)
        self.label_two = Label(text='', size_hint=(1, .1), markup=True)
        self.progress_load = Progress()
        self.button_cancel = Button(
            text='Cancel', on_press=self.events_callback, size_hint=(1, .1),
            background_normal=self.background_image_buttons[0],
            background_down=self.background_image_shadows[0]
        )

        self.label_one.bind(size=lambda *args: self._update_text_size(args))
        self.label_two.bind(size=lambda *args: self._update_text_size(args))

        self.box.add_widget(self.label_one)
        self.box.add_widget(self.label_two)
        self.box.add_widget(Widget(size_hint=(None, .02)))
        self.box.add_widget(SettingSpacer())
        self.box.add_widget(Widget(size_hint=(None, .02)))
        self.box.add_widget(self.progress_load)
        self.box.add_widget(Widget(size_hint=(None, .3)))
        self.box.add_widget(SettingSpacer())
        self.box.add_widget(Widget(size_hint=(None, .02)))
        self.box.add_widget(self.button_cancel)

        self.progress_load.min = 0
        self.progress_load.max = 100
        self.progress_load.bar_value = 0
        self.progress_load.height_widget = self.dp(self.progress_line_height)
        self.progress_load.color = self.progress_line_color
        self.progress_load.border_color = self.progress_border_color 
开发者ID:HeaTTheatR,项目名称:Easy,代码行数:35,代码来源:pdialog.py

示例4: __init__

# 需要导入模块: import progress [as 别名]
# 或者: from progress import Progress [as 别名]
def __init__(self, **kvargs):
        super(PDialog, self).__init__(**kvargs)

        self.box = BoxLayout(orientation='vertical')
        self.label_one = Label(text='', size_hint=(1, .1), markup=True)
        self.label_two = Label(text='', size_hint=(1, .1), markup=True)
        self.progress_load = Progress()
        self.button_cancel = Button(
            text='Cancel', on_press=self.events_callback, size_hint=(1, .1),
            background_normal=self.background_image_buttons[0],
            background_down=self.background_image_shadows[0],
            background_color=choice(self.background_color_buttons)
        )

        self.label_one.bind(size=lambda *args: self._update_text_size(args))
        self.label_two.bind(size=lambda *args: self._update_text_size(args))

        self.box.add_widget(self.label_one)
        self.box.add_widget(self.label_two)
        self.box.add_widget(Widget(size_hint=(None, .02)))
        self.box.add_widget(SettingSpacer())
        self.box.add_widget(Widget(size_hint=(None, .02)))
        self.box.add_widget(self.progress_load)
        self.box.add_widget(Widget(size_hint=(None, .3)))
        self.box.add_widget(SettingSpacer())
        self.box.add_widget(Widget(size_hint=(None, .02)))
        self.box.add_widget(self.button_cancel)

        self.progress_load.min = 0
        self.progress_load.max = 100
        self.progress_load.bar_value = 0
        self.progress_load.height_widget = self.dp(self.progress_line_height)
        self.progress_load.color = self.progress_line_color
        self.progress_load.border_color = self.progress_border_color 
开发者ID:HeaTTheatR,项目名称:kdialog,代码行数:36,代码来源:pdialog.py


注:本文中的progress.Progress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。