Exemplo n.º 1
0
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
from pystorm.services import FetchService
from pystorm.tasks import TaskObject
from pystorm.report import parse_bytes, parse_time

# Start fetch services 
fetch_service = FetchService(2)
fetch_service.start()

url_list = [
    "http://packages.linuxdeepin.com/deepin/pool/main/d/deepin-emacs/deepin-emacs_1.1-3_all.deb", 
    "http://packages.linuxdeepin.com/deepin/pool/main/d/deepinwine-qq2012/deepinwine-qq2012_0.0.1_i386.deb",
    "http://packages.linuxdeepin.com/deepin/pool/main/d/deepinwine-qq2011/deepinwine-qq2011_0.0.1_i386.deb",
    "http://packages.linuxdeepin.com/deepin/pool/main/d/deepinwine-qq2009/deepinwine-qq2009_0.0.2_all.deb"
            ]

task_list = [ TaskObject(url) for url in url_list]

def update_state(name, obj, data, output_file):
    progress = "%d%%" % data.progress
    speed = parse_bytes(data.speed)
    remaining = parse_time(data.remaining)
Exemplo n.º 2
0
#! /usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (C) 2011 ~ 2012 Deepin, Inc.
#               2011 ~ 2012 Hou Shaohui
# 
# Author:     Hou Shaohui <*****@*****.**>
# Maintainer: Hou Shaohui <*****@*****.**>
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from pystorm.services import FetchService
from pystorm.tasks import TaskObject

fetch_service = FetchService(5)
fetch_service.start()

import logging
logging.basicConfig(level=logging.ERROR)
from pystorm.services import FetchService
from pystorm.tasks import TaskObject
from constant import GAME_CENTER_DATA_ADDRESS, GAME_CENTER_SERVER_ADDRESS
import os
import json
import threading as td
from deepin_utils.file import touch_file_dir
from events import global_event

import urllib
import urllib2

fetch_service = FetchService(1)
fetch_service.start()

class FetchSwf(td.Thread):
    def __init__(self, ):
        td.Thread.__init__(self)
        self.setDaemon(True)

    def run(self):
        pass

class SetStarScore(td.Thread):
    def __init__(self, appid, star):
        td.Thread.__init__(self)
        self.daemon = True
        self.appid = appid
Exemplo n.º 4
0
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
from pystorm.services import FetchService
from pystorm.tasks import TaskObject
from pystorm.report import parse_bytes, parse_time

# Start fetch services
fetch_service = FetchService(2)
fetch_service.start()

url_list = [
    "http://packages.linuxdeepin.com/deepin/pool/main/d/deepin-emacs/deepin-emacs_1.1-3_all.deb",
    "http://packages.linuxdeepin.com/deepin/pool/main/d/deepinwine-qq2012/deepinwine-qq2012_0.0.1_i386.deb",
    "http://packages.linuxdeepin.com/deepin/pool/main/d/deepinwine-qq2011/deepinwine-qq2011_0.0.1_i386.deb",
    "http://packages.linuxdeepin.com/deepin/pool/main/d/deepinwine-qq2009/deepinwine-qq2009_0.0.2_all.deb"
]

task_list = [TaskObject(url) for url in url_list]


def update_state(task, data):
    progress = "%d%%" % data.progress
    speed = parse_bytes(data.speed)