Пример #1
0
 def test_compose_with_multiple_markups(self):
     article = {
         "title": "title",
         "subtitle": "subtitle",
         "paragraphs": [
             {
                 "type": "P",
                 "text": "This is a testing paragraph",
                 "markups": [
                     {
                         "type": "STRONG",
                         "start": 5,
                         "end": 7
                     },
                     {
                         "type": "EM",
                         "start": 10,
                         "end": 17
                     }
                 ]
             }
         ]
     }
     result = composer.compose(article, lambda i: '', StylerStub(), None, [])
     expected = {
         "title": "title",
         "subtitle": "subtitle",
         "content": "<div><p>This <strong>is</strong> a <i>testing</i> paragraph</p></div>"
     }
     self.assertEqual(result, expected)
Пример #2
0
def init():
    command = sys.argv[1]

    if command == "parse":
        inputFolder = "./"
        outputFile = "output"
        markovOrder = 1
        parseFor = "pitch"
        for i in range(2, len(sys.argv)):
            if "input" in sys.argv[i]:
                inputFolder = sys.argv[i].split("=")[1]
            elif "output" in sys.argv[i]:
                outputFile = sys.argv[i].split("=")[1]
            elif "order" in sys.argv[i]:
                markovOrder = sys.argv[i].split("=")[1]
            elif "parse" in sys.argv[i]:
                parseFor = sys.argv[i].split("=")[1]
            else:
                print "ERROR: %s isn't a argument" % sys.argv[i].split("=")[0]
        parseMidis(inputFolder, outputFile, markovOrder, parseFor)

    elif command == "compose":
        rhythmInputFileName = "./input.mid"
        pitchInputFileName = "./input.mid"
        outputFileName = "output.mid"
        length = 120
        for i in range(2, len(sys.argv)):
            if "rInput" in sys.argv[i]:
                rhythmInputFileName = sys.argv[i].split("=")[1]
            elif "pInput" in sys.argv[i]:
                pitchInputFileName = sys.argv[i].split("=")[1]
            elif "output" in sys.argv[i]:
                outputFileName = sys.argv[i].split("=")[1]
            elif "length" in sys.argv[i]:
                length = sys.argv[i].split("=")[1]
            else:
                print "ERROR: %s isn't a argument" % sys.argv[i].split("=")[0]
        compose(pitchInputFileName, rhythmInputFileName, outputFileName,
                length)

    else:
        print "ERROR: %s isn't a command" % command
Пример #3
0
def init():
    action = sys.argv[1]

    if action == "grabData":
        sourceFolder = sys.argv[2]
        destinationFile = sys.argv[3]
        sequenceLength = sys.argv[4]
        writeToFile(sourceFolder, destinationFile, sequenceLength)

    elif action == "compose":
        # conductor.py source.json example.mid 240
        sourceFile = sys.argv[2]
        outputFileName = sys.argv[3]

        if len(sys.argv) > 4:
            length = sys.argv[4]
        else:
            length = 120

        compose(sourceFile, outputFileName, length)
Пример #4
0
 def test_compose_basic(self):
     article = {
         "title": "title",
         "subtitle": "subtitle",
         "paragraphs": [
             {
                 "type": "P",
                 "text": "This is a testing paragraph",
                 "markups": []
             }
         ]
     }
     result = composer.compose(article, lambda i: '', StylerStub(), None, [])
     expected = {
         "title": "title",
         "subtitle": "subtitle",
         "content": "<div><p>This is a testing paragraph</p></div>"
     }
     self.assertEqual(result, expected)
def compose_song(requset):
    song = composer.compose()
    return redirect(reverse('composer_song', kwargs={'key': song.key}))
Пример #6
0
def compose_song(requset):
    song = composer.compose()
    return redirect(reverse('composer_song', kwargs={'key': song.key}))
Пример #7
0
    
    Gegebenenfalls sollten wir drüber nachdenken die Limiter in eigene Funktion kabseln
    
    Wir müssen schauen, dass wir auch die englischen Videos herruntergeladen bekommen
    
    Welche Kategorie brauchen unsere videos? Siehe die 'category' in video file uploader
    
    Überleg mal eine Datenstruktur mit allen Informationen durch die Piepeline zu schicken,
    möglichwerweise sollte man dann über einen rewrite und eine gute Kapselung nachdenken
    
    Es stimmt etwas mit den Bildern nicht, sie scheinen gezoomt zu werden."""

# +++++ Handle the trailers +++++
if debugging['upload_trailer']:
    # Upload each trailer
    for video in game_resources['videos']:
        youtubeUploader.upload(VideoFileClip(video), steam_params)

# +++++ Handle the composed video +++++
if debugging['compose_video']:
    # Compose the final video
    composed_video = composer.compose(game_resources, steam_params)

    # Clean all data which isn´t needed anymore
    du.run_cleaner(steam_params, composed_video)

    # If activated, upload the composed video to the youtube channel
    if debugging['upload_composed_video']:
        youtubeUploader.upload(composed_video, steam_params)
        steamScrapper.set_game_as_processed(game_id)
Пример #8
0
from crawler import crawl_medium
from composer import compose
from wechat_client import upload_image, upload_article
import styler
import footer_decorator
import zh_converter

# url = 'https://bit.ly/eating-social-tactics'
url = 'https://bit.ly/eating-amaz'
article_data = crawl_medium(url)
article = compose(article_data, upload_image, styler, footer_decorator,
                  [zh_converter])
# article = compose(article_data, lambda i: '', styler, footer_decorator, [zh_converter])
upload_article(article)