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