]> git.parisson.com Git - tools.git/commitdiff
update
authoryomguy <yomguy@457c0346-1240-4656-8a5a-9edca8063506>
Fri, 17 Jul 2009 21:32:04 +0000 (21:32 +0000)
committeryomguy <yomguy@457c0346-1240-4656-8a5a-9edca8063506>
Fri, 17 Jul 2009 21:32:04 +0000 (21:32 +0000)
git-svn-id: http://svn.parisson.org/svn/tools/trunk@65 457c0346-1240-4656-8a5a-9edca8063506

python-awstats/awstats.py
python-dav/dav_upload_pb.py
various/webthumb.py
various/webthumb_list.py

index 9d06788a2abc883323a1a523ecf6c33dbcf111a2..1463d11baaae419e03e505dd8c7b122e9b42e43a 100755 (executable)
@@ -184,6 +184,11 @@ def main():
     a = ApacheConfig('/etc/apache2/sites-available/')
     w = AwstatsConfig('/etc/awstats/')
 
+<<<<<<< .mine
+#print w.get_confs(  )
+print w.get_domains()
+print w.get_custom_logs()
+=======
     print a.get_domains()
     print a.get_custom_logs()
 
@@ -195,3 +200,4 @@ def main():
 if __name__ == '__main__':
     main()
 
+>>>>>>> .r64
index 768e5b960be196d9193c0fd8eb60f523084bcac8..1c7c7f851a5ce43fec1b677919da7ad7436495d9 100644 (file)
@@ -16,12 +16,13 @@ HOST = 'localhost'
 PORT = '1983'
 BASE = 'http://%s:%s' % (HOST, PORT)
 USERNAME = 'zope'
-#DESTDIR = 'crfpa/formations/formations-en-ligne/cours-audio/'
-DESTDIR = 'crfpa/test/'
+DESTDIR = 'CRFPA/formations/formations-en-ligne/cours-audio/'
+#DESTDIR = 'CRFPA/'
 TITLE = 'Pre-barreau_-_Augustins_-_CRFPA_-_'
 SOURCEDIR = '/home/augustins/audio/media/CRFPA/2008/'
 #PASSWORD = sys.argv[1]
 PASSWORD = 'wasncellar;z'
+COURSES = 'pre-barreau_courses_crfpa.txt'
 
 
 
@@ -121,6 +122,15 @@ def upload(base, title, dest_dir, source_dir, username, password, encodeduserpas
       f = open(source_dir + os.sep +_dir + os.sep + file,'r')
       _dav().put(base+'/'+_dest_dir+'/'+file,f.read(),None,None,auth_dict)
 
+def init(base, title, dest_dir, source_dir, username, password, encodeduserpass):
+  _dav().setauth(username, password)
+  auth_dict = {"Authorization":"Basic %s" % encodeduserpass}
+  auth = auth_dict['Authorization']
+  print auth
+  f = open(COURSES, 'r')
+  courses = f.readlines()
+  for course in courses:
+    _dav().mkcol(base+'/'+dest_dir+course.lower()+'/'+'Archives_Audio',auth)
 
 if __name__ == '__main__':
   if HOST == 'FILL THIS IN':
@@ -131,4 +141,6 @@ if __name__ == '__main__':
     sys.exit(1)
 
   encodedUSERPASS = base64.encodestring(USERNAME+":"+PASSWORD)
-  upload(BASE, TITLE, DESTDIR, SOURCEDIR, USERNAME, PASSWORD, encodedUSERPASS)
+  #upload(BASE, TITLE, DESTDIR, SOURCEDIR, USERNAME, PASSWORD, encodedUSERPASS)
+  init(BASE, TITLE, DESTDIR, SOURCEDIR, USERNAME, PASSWORD, encodedUSERPASS)
+
index 30ecbf0987f77367588ed3b6a66c85f1802e37fb..a6e98509f7f62bdf067d7b999d9caa24d81ca831 100644 (file)
@@ -56,7 +56,7 @@ def get_thumbnail(url, output_path, size='medium2'):
     if type == 'text/xml':
         # This is defined as 'success' by the API. text/plain is failure.
         doc = xml.dom.minidom.parseString(body)
-
+       wait = 1
         for node in doc.getElementsByTagName("job"):
             wait = node.getAttribute('estimate')
             key = ""
index c39da4dfe31635afa894c6d94c9c40a99caf446c..825a17141e55d718b667f89be20c2e02d4db7de6 100755 (executable)
@@ -14,14 +14,12 @@ def main(site_list_file, img_dir):
     site_list = open(site_list_file,'r')
     for site in site_list.readlines():
         site = site[0:len(site)-1]
-        print site
-       file = site.replace('/','_')
-       file = img_dir+os.sep+site+'.png'
-        get_thumbnail('http://'+site, file,'large')
-        #command = 'webthumb http://'+ site +' | pnmscale -xysize 650 400 | ' + \
-        #          'pnmtopng | convert -crop 510x275+5+60 - ' + img_dir + os.sep + site +'.png'
-        #print command
-        #os.system(command)
+        if site:
+           print site
+            file = site.replace('/','_')
+            file = img_dir+os.sep+file+'.png'
+            print file
+            get_thumbnail('http://'+site, file,'large')
     site_list.close()
     print 'Webthumbs created !'