。。。。

public class DylanLineMarkerProvider implements LineMarkerProvider { 
  protected final DaemonCodeAnalyzerSettings myDaemonSettings; 
  protected final EditorColorsManager myColorsManager; 
 
  public DylanLineMarkerProvider(DaemonCodeAnalyzerSettings daemonSettings, EditorColorsManager colorsManager) { 
    myDaemonSettings = daemonSettings; 
    myColorsManager = colorsManager; 
  } 
 
  @Override 
  @Nullable 
  public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) { 
    if (myDaemonSettings.SHOW_METHOD_SEPARATORS) { 
      if (element instanceof DylanDefinition) { 
        LineMarkerInfo info = new LineMarkerInfo<PsiElement>(element, element.getTextRange(), null, Pass.UPDATE_ALL, 
                                                             FunctionUtil.<Object, String>nullConstant(), null, 
                                                             GutterIconRenderer.Alignment.RIGHT); 
        EditorColorsScheme scheme = myColorsManager.getGlobalScheme(); 
        info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEPARATORS_COLOR); 
        info.separatorPlacement = SeparatorPlacement.BOTTOM; 
        return info; 
      } 
    } 
    return null; 
  } 
 
  @Override 
  public void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result) { 
  } 
}

  

public class DylanParserDefinition implements ParserDefinition { 
  public static final IFileElementType FILE = new IFileElementType(DylanLanguage.INSTANCE); 
 
  @NotNull 
  @Override 
  public Lexer createLexer(Project project) { 
    return new DylanFlexLexer(); 
  } 
 
  @NotNull 
  public TokenSet getWhitespaceTokens() { 
    return WHITE_SPACES; 
  } 
 
  @NotNull 
  public TokenSet getCommentTokens() { 
    return COMMENTS; 
  } 
 
  @NotNull 
  public TokenSet getStringLiteralElements() { 
    return TokenSet.EMPTY; 
  } 
 
  @NotNull 
  public PsiParser createParser(final Project project) { 
    return new DylanParser(); 
  } 
 
  @Override 
  public IFileElementType getFileNodeType() { 
    return FILE; 
  } 
 
  public PsiFile createFile(FileViewProvider viewProvider) { 
    return new DylanFile(viewProvider); 
  } 
 
  public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) { 
    return SpaceRequirements.MAY; 
  } 
 
  @NotNull 
  public PsiElement createElement(ASTNode node) { 
    return DylanTypes.Factory.createElement(node); 
  } 
}

  

 

#实例化jenkins对象,连接远程的jenkins master server

   server=jenkins.Jenkins(jenkins_server_url, username=user_id, password=api_token)

   #构建job名为job_name的job(不带构建参数)

   server.build_job(job_name)

   #String参数化构建job名为job_name的job, 参数param_dict为字典形式,如:param_dict= {"param1":“value1”, “param2”:“value2”} 

   server.build_job(job_name, parameters=param_dict)

   #获取job名为job_name的job的相关信息

   server.get_job_info(job_name)

   #获取job名为job_name的job的最后次构建号

   server.get_job_info(job_name)['lastBuild']['number']

     #获取job名为job_name的job的某次构建的执行结果状态

   server.get_build_info(job_name,build_number)['result']     

     #判断job名为job_name的job的某次构建是否还在构建中

   server.get_build_info(job_name,build_number)['building']

  http://blog.csdn.net/neven7/article/details/52741534

posted @ 2017-05-17 07:06  liqiking  阅读(187)  评论(0编辑  收藏  举报