Mercurial > repos > eric-rasche > apollo
annotate fetch_organism_jbrowse.py @ 7:f9a6e151b3b4 draft
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
author | eric-rasche |
---|---|
date | Tue, 27 Jun 2017 04:05:17 -0400 |
parents | d4ae83dedb14 |
children |
rev | line source |
---|---|
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
1 #!/usr/bin/env python |
7
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
2 from __future__ import print_function |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
3 import os |
7
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
4 import sys |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
5 import time |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
6 import argparse |
7
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
7 import filecmp |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
8 import os.path |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
9 import logging |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
10 import subprocess |
7
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
11 from webapollo import WAAuth, WebApolloInstance, GuessOrg, OrgOrGuess |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
12 logging.basicConfig(level=logging.INFO) |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
13 log = logging.getLogger(__name__) |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
14 |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
15 |
7
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
16 def are_dir_trees_equal(dir1, dir2): |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
17 """ |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
18 Compare two directories recursively. Files in each directory are |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
19 assumed to be equal if their names and contents are equal. |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
20 |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
21 @param dir1: First directory path |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
22 @param dir2: Second directory path |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
23 |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
24 @return: True if the directory trees are the same and |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
25 there were no errors while accessing the directories or files, |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
26 False otherwise. |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
27 |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
28 # http://stackoverflow.com/questions/4187564/recursive-dircmp-compare-two-directories-to-ensure-they-have-the-same-files-and/6681395#6681395 |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
29 """ |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
30 |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
31 dirs_cmp = filecmp.dircmp(dir1, dir2) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
32 if len(dirs_cmp.left_only) > 0 or len(dirs_cmp.right_only) > 0 or \ |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
33 len(dirs_cmp.funny_files) > 0: |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
34 print(('LEFT', dirs_cmp.left_only)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
35 print(('RIGHT', dirs_cmp.right_only)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
36 print(('FUNNY', dirs_cmp.funny_files)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
37 return False |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
38 (_, mismatch, errors) = filecmp.cmpfiles( |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
39 dir1, dir2, dirs_cmp.common_files, shallow=False) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
40 if len(mismatch) > 0 or len(errors) > 0: |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
41 print(mismatch) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
42 print(errors) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
43 return False |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
44 for common_dir in dirs_cmp.common_dirs: |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
45 new_dir1 = os.path.join(dir1, common_dir) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
46 new_dir2 = os.path.join(dir2, common_dir) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
47 if not are_dir_trees_equal(new_dir1, new_dir2): |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
48 return False |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
49 return True |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
50 |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
51 |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
52 if __name__ == '__main__': |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
53 parser = argparse.ArgumentParser(description='Sample script to add an attribute to a feature via web services') |
3
d4ae83dedb14
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4ac38d0b6dba1183f3e78eb5c224c7051064b4a5
eric-rasche
parents:
0
diff
changeset
|
54 WAAuth(parser) |
d4ae83dedb14
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4ac38d0b6dba1183f3e78eb5c224c7051064b4a5
eric-rasche
parents:
0
diff
changeset
|
55 OrgOrGuess(parser) |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
56 parser.add_argument('target_dir', help='Target directory') |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
57 |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
58 args = parser.parse_args() |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
59 |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
60 wa = WebApolloInstance(args.apollo, args.username, args.password) |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
61 # User must have an account |
3
d4ae83dedb14
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4ac38d0b6dba1183f3e78eb5c224c7051064b4a5
eric-rasche
parents:
0
diff
changeset
|
62 org_cn = GuessOrg(args, wa) |
d4ae83dedb14
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4ac38d0b6dba1183f3e78eb5c224c7051064b4a5
eric-rasche
parents:
0
diff
changeset
|
63 if isinstance(org_cn, list): |
d4ae83dedb14
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4ac38d0b6dba1183f3e78eb5c224c7051064b4a5
eric-rasche
parents:
0
diff
changeset
|
64 org_cn = org_cn[0] |
d4ae83dedb14
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4ac38d0b6dba1183f3e78eb5c224c7051064b4a5
eric-rasche
parents:
0
diff
changeset
|
65 org = wa.organisms.findOrganismByCn(org_cn) |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
66 |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
67 if not os.path.exists(args.target_dir): |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
68 os.makedirs(args.target_dir) |
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
69 |
7
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
70 if not os.path.exists(os.path.join(org['directory'], 'seq')): |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
71 sys.stderr.write("Missing seq directory BEFORE copy") |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
72 sys.exit(1) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
73 |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
74 cmd = [ |
7
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
75 'rsync', '-avr', |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
76 org['directory'].rstrip('/') + '/', |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
77 os.path.join(args.target_dir, 'data', '') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
78 ] |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
79 # We run this OBSESSIVELY because my org had a hiccup where the origin |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
80 # (silent) cp -R failed at one point. This caused MANY HEADACHES. |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
81 # |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
82 # Our response is to run this 3 times (in case the issue is temporary), |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
83 # with delays in between. And ensure that we have the correct number of |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
84 # files / folders before and after. |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
85 sys.stderr.write(' '.join(cmd)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
86 sys.stderr.write('\n') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
87 sys.stderr.write(subprocess.check_output(cmd)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
88 if not are_dir_trees_equal( |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
89 os.path.join(org['directory'].rstrip('/')), |
0
6002cc0df04e
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 4e5a5af7689f1713c34a6ad9a9594c205e762fdd
eric-rasche
parents:
diff
changeset
|
90 os.path.join(args.target_dir, 'data') |
7
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
91 ): |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
92 # Not good |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
93 time.sleep(5) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
94 sys.stderr.write('\n') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
95 sys.stderr.write(' '.join(cmd)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
96 sys.stderr.write('\n') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
97 sys.stderr.write(subprocess.check_output(cmd)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
98 if not are_dir_trees_equal( |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
99 os.path.join(org['directory'].rstrip('/'), 'data'), |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
100 os.path.join(args.target_dir, 'data') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
101 ): |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
102 time.sleep(5) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
103 sys.stderr.write('\n') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
104 sys.stderr.write(' '.join(cmd)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
105 sys.stderr.write('\n') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
106 sys.stderr.write(subprocess.check_output(cmd)) |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
107 if not are_dir_trees_equal( |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
108 os.path.join(org['directory'].rstrip('/'), 'data'), |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
109 os.path.join(args.target_dir, 'data') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
110 ): |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
111 sys.stderr.write('FAILED THREE TIMES TO COPY. SOMETHING IS WRONG WRONG WRONG.') |
f9a6e151b3b4
planemo upload for repository https://github.com/TAMU-CPT/galaxy-webapollo commit 52b9e5bf6a6efb09a5cb845ee48703651c644174
eric-rasche
parents:
3
diff
changeset
|
112 sys.exit(2) |