-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated commit -> added return statement to parser in jatosapi
- Loading branch information
1 parent
60975bf
commit 00165b1
Showing
1 changed file
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ def parse_cmd(): | |
import argparse | ||
parser = argparse.ArgumentParser(description='API File to Pull Subject Data from Jatos') | ||
parser.add_argument('-t', type=str, help='TEASE') | ||
parser.add_argument('-a', type=str, help="toke") | ||
return parser.parse_args() | ||
|
||
|
||
|
@@ -226,19 +227,33 @@ def move_txt(txt_files): | |
|
||
|
||
|
||
def push(toke): | ||
#use the folder name as task | ||
task = os.path.basename(os.getcwd()) | ||
|
||
def push(): | ||
import git | ||
repo = git.Repo('./') | ||
repo.git.add('.') | ||
repo.git.commit('-m', 'new data') | ||
origin = repo.remote(name='origin') | ||
origin.push() | ||
return None | ||
subprocess.run(['git', 'config', 'user.email', '[email protected]']) | ||
subprocess.run(['git', 'remote', 'set-url', 'origin', f'https://miloswrath:{toke}@github.com/HBClab/{task}']) | ||
subprocess.run(['git', 'config', 'user.name', 'miloswrath']) | ||
subprocess.run(['git', 'add', '.']) | ||
subprocess.run(['git', 'commit', '-m', 'Automated Commit -> New Data']) | ||
subprocess.run(['git', 'push', 'origin', 'main']) | ||
|
||
|
||
def push(toke): | ||
#use the folder name as task | ||
task = os.path.basename(os.getcwd()) | ||
|
||
subprocess.run(['git', 'config', 'user.email', '[email protected]']) | ||
subprocess.run(['git', 'remote', 'set-url', 'origin', f'https://miloswrath:{toke}@github.com/HBClab/{task}']) | ||
subprocess.run(['git', 'config', 'user.name', 'miloswrath']) | ||
subprocess.run(['git', 'add', '.']) | ||
subprocess.run(['git', 'commit', '-m', 'Automated Commit -> New Data']) | ||
subprocess.run(['git', 'push', 'origin', 'main']) | ||
|
||
def main(): | ||
args = parse_cmd() | ||
tease = args.t | ||
toke = args.a | ||
study_result_ids = get_met(tease) | ||
get_data(study_result_ids, tease) | ||
convert_beh() | ||
|
@@ -248,7 +263,7 @@ def main(): | |
if file.endswith(".txt"): | ||
txt_files.append(os.path.join(root, file)) | ||
move_txt(txt_files) | ||
push() | ||
push(toke) | ||
|
||
|
||
|
||
|