Changeset 4131 for trunk/makeTutorial.py


Ignore:
Timestamp:
Sep 2, 2019 10:29:27 AM (2 years ago)
Author:
toby
Message:

restore videos, deal with failure to test if box.com files are present

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/makeTutorial.py

    r3749 r4131  
    1919from __future__ import print_function
    2020import os
    21 import requests
     21#import requests
    2222import GSASIIpath
    2323#import GSASIIctrl as G2G
     24onlineVideos = []
     25'''a list of videos that are in box, since I don't know how to check if they
     26are present anymore
     27'''
     28onlineVideos.append('https://anl.box.com/v/CalibrationofanareadetectorinG')
     29onlineVideos.append('https://anl.box.com/v/CalibrationTutorial')
     30onlineVideos.append('https://anl.box.com/v/CalibrationofaTOFpowderdiffrac')
     31onlineVideos.append('https://anl.box.com/v/Combinedrefinement')
     32onlineVideos.append('https://anl.box.com/v/TOFcombinedXNRietveldrefinemen')
     33onlineVideos.append('https://anl.box.com/v/NeutronCWPowderData')
     34onlineVideos.append('https://anl.box.com/v/FindProfParamCW')
     35onlineVideos.append('https://anl.box.com/v/DeterminingWavelength')
     36onlineVideos.append('https://anl.box.com/v/FitPeaks----')
     37onlineVideos.append('https://anl.box.com/v/LaboratoryX-')
     38onlineVideos.append('https://anl.box.com/v/FittingSmallAngleScatteringDat')
     39onlineVideos.append('https://anl.box.com/v/FitBkgTut---')
     40onlineVideos.append('https://anl.box.com/v/SmallAngleImageProcessing')
     41onlineVideos.append('https://anl.box.com/v/Integrationofareadetectordatai')
     42onlineVideos.append('https://anl.box.com/v/MerohedraltwinrefinementinGSAS')
     43onlineVideos.append('https://anl.box.com/v/ParametricFitting')
     44onlineVideos.append('https://anl.box.com/v/SequentialRefinementofSmallAng')
     45onlineVideos.append('https://anl.box.com/v/SequentialTutorial')
     46onlineVideos.append('https://anl.box.com/v/SimpleMagnetic')
     47onlineVideos.append('https://anl.box.com/v/SimTutorial-')
     48onlineVideos.append('https://anl.box.com/v/SmallAngleSizeDistribution')
     49onlineVideos.append('https://anl.box.com/v/StackingFaults-I')
     50onlineVideos.append('https://anl.box.com/v/StartingGSAS')
     51onlineVideos.append('https://anl.box.com/v/Strainfittingof2DdatainGSAS-II')
     52onlineVideos.append('https://anl.box.com/v/Textureanalysisof2DdatainGSAS-')
     53onlineVideos.append('https://anl.box.com/v/TOFSequentialSinglePeakFit')
     54#onlineVideos.append('
    2455
    2556if __name__ == '__main__':
     
    71102           
    72103            # check for video tutorial
    73             vname = 'https://anl.box.com/v/' + os.path.splitext(l[1])[0].replace(' ','')[:30]
    74             if requests.get(vname).status_code == 200:
     104            videoName = '{:-<12s}'.format(
     105                os.path.splitext(l[1])[0].replace(' ','')[:30])           
     106            vname = 'https://anl.box.com/v/{}'.format(videoName)
     107            #if requests.get(vname).status_code == 200:
     108            if vname in onlineVideos:
    75109                video = '<A href="{}">video</A>'.format(vname)
    76110                #print(' [link: <A href="{}">video</A>]'.format(vname),file=out)
     
    79113            else:
    80114                video =''
    81                 print('No video for',vname)
     115                print('No video for {:45s}{}'.format(videoName,l[2]))
    82116            # check for data
    83117            if GSASIIpath.svnList(dataURL,False):
Note: See TracChangeset for help on using the changeset viewer.