예제 #1
0
from com_fm import *
import gzip

fd = open(url, "r")
content = fd.read()
fnew = gzip.GzipFile(mode="wb", fileobj=content)
fd.close()

zipfilemd5 = fnew.file_md5()

# insert it to swift
test_conn = Connection(authurl=SWIFT_AUTHURL,
                       user="******",
                       key="admin_pass",
                       retries=5,
                       auth_version='2',
                       os_options=SWIFT_OS_OPTIONS,
                       snet=False,
                       cacert=None,
                       insecure=False,
                       ssl_compression=True)
op = com_fm("crawl_webpage")
apk_path = app_md5 + '.html'
res = op.upload(app_local_path, apk_path)
safe_remove(app_local_path)
예제 #2
0
 def __init__(self):
     self._conn = None
     self.op = com_fm("android_pipeline")
     self.wp = com_fm("crawl_webpage")
     dispatcher.connect(self.init_db, signals.engine_started)
     dispatcher.connect(self.fini_db, signals.engine_stopped)
예제 #3
0
    
def Get_Detail_Apk():
   
    print "---------in Get Detail Apk--------"
    
    try:
        tarfile = 'tar zxvf ' + AndroidPhonePath + ' -C /var/www/SAWeb/static/upload_tmp' 
        os.system(tarfile)
        log_f.write(time.strftime('%Y-%m-%d:%H:%m:%s',time.localtime(time.time())) + ": Extracting the AndroidPhone.tar.gz" + "\n")
    except Exception, e:
        log_f.write(time.strftime('%Y-%m-%d:%H:%m:%s',time.localtime(time.time())) + ": " + str(e) + "\n")
        print e 
    print "----------after tar-----------------------------" 
    Detail_info = []
    Apk_Odex_Frame_info = []
    op = com_fm("android_pipeline")

    Apk_file = {}
    Txt_file = []
    try:
        for parent, dirnames, filenames in os.walk(FileLocaltion):
            for filename in filenames:
                if '.apk' in filename:
                    key = FileLocaltion+ "/" +filename
                    value = Get_File_MD5(FileLocaltion+ "/" +filename) + '.apk'
                    print "--------------", op.upload(key,value), '-------------'
                
                    Apk_file[key] = value
                    print "-----------apk--size--------------",len(Apk_file)
                else:
                    Txt_file.append(FileLocaltion+ "/" +filename)
예제 #4
0
파일: test.py 프로젝트: yuedong111/scrapy
from com_fm import *
import gzip

fd = open(url, "r")
content = fd.read()
fnew = gzip.GzipFile(mode="wb", fileobj=content)
fd.close()

zipfilemd5 = fnew.file_md5()

# insert it to swift
test_conn = Connection(authurl=SWIFT_AUTHURL,user="******",key="admin_pass",retries=5,auth_version='2',os_options=SWIFT_OS_OPTIONS,snet=False,cacert=None,insecure=False,ssl_compression=True)
op = com_fm("crawl_webpage")
apk_path = app_md5 + '.html'
res = op.upload(app_local_path, apk_path)
safe_remove(app_local_path)