/*
 * Copyright 2000-2013 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jetbrains.python.codeInsight.liveTemplates;

import com.intellij.codeInsight.template.FileTypeBasedContextType;
import com.jetbrains.python.PythonFileType;

/**
 * @author yole
 */
public class PythonTemplateContextType extends FileTypeBasedContextType {
  public PythonTemplateContextType() {
    super("Python", "Python", PythonFileType.INSTANCE);
  }
}

@@ -733,232 +733,1257 @@
 com.
-jetbrains.python.PythonFileType;%0A%0A/**%0A * @author yole%0A */%0Apublic class PythonTemplateContextType extends FileTypeBasedContextType %7B%0A  public PythonTemplateContextType() %7B%0A    super(%22Python%22, %22Python%22, PythonFileType.INSTANCE
+intellij.patterns.PsiElementPattern;%0Aimport com.intellij.psi.PsiElement;%0Aimport com.intellij.psi.PsiFile;%0Aimport com.intellij.util.ProcessingContext;%0Aimport com.jetbrains.python.PyTokenTypes;%0Aimport com.jetbrains.python.PythonFileType;%0Aimport org.jetbrains.annotations.NotNull;%0A%0Aimport static com.intellij.patterns.PlatformPatterns.psiElement;%0A%0A/**%0A * @author yole%0A */%0Apublic class PythonTemplateContextType extends FileTypeBasedContextType %7B%0A  public PythonTemplateContextType() %7B%0A    super(%22Python%22, %22Python%22, PythonFileType.INSTANCE);%0A  %7D%0A%0A  @Override%0A  public boolean isInContext(@NotNull PsiFile file, int offset) %7B%0A    if (super.isInContext(file, offset)) %7B%0A      final PsiElement element = file.findElementAt(offset);%0A      if (element != null) %7B%0A        return !isAfterDot(element);%0A      %7D%0A    %7D%0A    return false;%0A  %7D%0A%0A  private static boolean isAfterDot(@NotNull PsiElement element) %7B%0A    ProcessingContext context = new ProcessingContext();%0A    final PsiElementPattern.Capture%3CPsiElement%3E capture = psiElement().afterLeafSkipping(psiElement().whitespace(),%0A                                                                                         psiElement().withElementType(PyTokenTypes.DOT));%0A    return capture.accepts(element, context
 );%0A 

Don't suggest Python live templates after '.' in qualified names