From 4158eb0ad133c6fbb649d6ff75bfa2ad49da0816 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Tue, 7 Dec 2010 16:52:52 +0000 Subject: [PATCH] more magic from Jan Kaluza --- magic/Magdir/diff | 12 +++++++++++- magic/Magdir/python | 30 +++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/magic/Magdir/diff b/magic/Magdir/diff index 3eeced08..1c25aca9 100644 --- a/magic/Magdir/diff +++ b/magic/Magdir/diff @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: diff,v 1.10 2009/09/19 16:28:08 christos Exp $ +# $File: diff,v 1.11 2010/11/25 15:00:12 christos Exp $ # diff: file(1) magic for diff(1) output # 0 search/1 diff\ diff output text @@ -17,3 +17,13 @@ # bsdiff: file(1) magic for bsdiff(1) output 0 string/t BSDIFF40 bsdiff(1) patch file + + +# unified diff +0 search/4096 ---\ +>&0 search/1024 \n +>>&0 search/1 +++\ +>>>&0 search/1024 \n +>>>>&0 search/1 @@ unified diff output text +!:mime text/x-diff +!:strength + 90 diff --git a/magic/Magdir/python b/magic/Magdir/python index 065f875a..ab0d7a6b 100644 --- a/magic/Magdir/python +++ b/magic/Magdir/python @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: python,v 1.13 2010/08/12 16:16:44 christos Exp $ +# $File: python,v 1.14 2010/11/25 15:00:12 christos Exp $ # python: file(1) magic for python # # From: David Necas @@ -29,3 +29,31 @@ !:mime text/x-python 0 search/1 #!\ /usr/bin/env\ ruby Python script text executable !:mime text/x-python + + +# from module.submodule import func1, func2 +0 regex/b \^from\\s+(\\w|\\.)+\\s+import.*$ Python script text executable +!:mime text/x-python + +# def __init__ (self, ...): +0 search/4096 def\ __init__ +>&0 search/64 self Python script text executable +!:mime text/x-python + +# comments +0 search/4096 ''' +>&0 regex .*'''$ Python script text executable +!:mime text/x-python + +0 search/4096 """ +>&0 regex .*"""$ Python script text executable +!:mime text/x-python + +# try: +# except: or finally: +# block +0 search/4096 try: +>&0 regex \^\\s*except.*: Python script text executable +!:mime text/x-python +>&0 search/4096 finally: Python script text executable +!:mime text/x-python -- 2.40.0