Mercurial > repos > marcel > caddsuite_linux_x86_64
annotate CADDSuite-1.5/galaxyconfigs/confFiles.py @ 15:ac342506cd4e draft
CADDSuite version 1.5
author | Marcel Schumann <schumann.marcel@gmail.com> |
---|---|
date | Tue, 24 Jul 2012 11:08:49 -0400 |
parents | |
children |
rev | line source |
---|---|
15
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
1 # -*- coding: utf-8 -*- |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
2 """ |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
3 XML format classes |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
4 """ |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
5 import data |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
6 import logging |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
7 from galaxy.datatypes.sniff import * |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
8 import commands |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
9 |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
10 log = logging.getLogger(__name__) |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
11 |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
12 |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
13 class ini( data.Text ): |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
14 file_ext = "ini" |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
15 def sniff( self, filename ): |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
16 self.no_sections = commands.getstatusoutput("grep -c \"\[Docking-Settings\]\" "+filename) |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
17 if (self.no_sections[0] == 0) & (self.no_sections[1] > 0): |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
18 return True |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
19 else: |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
20 self.no_sections = commands.getstatusoutput("grep -c \"\[ReferenceArea\" "+filename) |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
21 if (self.no_sections[0] == 0) & (self.no_sections[1] > 0): |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
22 return True |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
23 else: |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
24 self.no_sections = commands.getstatusoutput("grep -c \"\[PharmacophoreConstraint\" "+filename) |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
25 if (self.no_sections[0] == 0) & (self.no_sections[1] > 0): |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
26 return True |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
27 else: |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
28 return False |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
29 |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
30 |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
31 |
ac342506cd4e
CADDSuite version 1.5
Marcel Schumann <schumann.marcel@gmail.com>
parents:
diff
changeset
|
32 |