Esempio n. 1
0
    def focus(self, group=None):
        de.ACTION(" <= " + self.name)
        self.focus_group(group)
        result = True

        if not de.exists("title_bar/{}".format(self.name)):
            region = de.FOCUS_VSCODE
            region.type(region, "p", sikuli.Key.CTRL)
            region.type(region, self.name + "\n")
            if de.exists("assorted/no_results_found", REGION_CTRL_P_SELECTION):
                print "No results found!"
                result = False
        de.CUT()
        return result
Esempio n. 2
0
def init(start_point, group=1):
    de.ACTION()
    if not sikuli.Region(de.X, de.Y, 30, 30).exists(de.get_image(
                                                        "assorted/vsc_icon")):
        de.exit("The VSCode window is not in position")
    de.kill_ffmpeg()
    el.ok_keyboard()
    el.hide_terminal_panel()
    
    if not de.exists("title_bar/start_point", de.REGION_TITLE_BAR):
        de.save_all()
        de.open_folder(start_point, "assorted/vsc_icon")

    el.hide_terminal_panel()
    el.hide_side_bar()
    el.close_all_editors()    
    
    narration = Edit("narration", group)
    if not narration.focus():
        de.open_file(de.NARRATION_FILE, "file_selection/narration")

    narration.type("", "w")
    print("Returning narration editor in group {}.".format(group))
    de.CUT()
    return narration
Esempio n. 3
0
def show_file(file_name, dir_name, scroll_count=0):
    de.ACTION()

    el.show_explorer()
    de.focus_group(1) 
    if not de.exists(
            "explorer/{}".format(file_name), de.REGION_SIDE_BAR, score=0.85):
        de.find("explorer/{}".format(dir_name), de.REGION_SIDE_BAR).click()
        de.hover(de.FOCUS_VSCODE)
    
    de.wait_image(
        "explorer/{}".format(file_name), de.REGION_SIDE_BAR, score=0.85).click()

    el.hide_side_bar()
    editor = Edit(file_name, 1)
    if scroll_count:
        editor.go_top()
        editor.scroll_down(count=scroll_count)

    de.CUT()
    return editor
Esempio n. 4
0
 def set_hight(self):
     de.ACTION(" <= Terminal")
     top_border = de.exists("terminal/TERMINAL")
     if top_border:
         de.drag_drop(top_border.offset(0, -15), de.REGION_COLUMN_BORDER)
     de.CUT()
Esempio n. 5
0
 def is_shown(self):
     return de.exists("terminal/TERMINAL", de.REGION_VSCODE)