Cleanup
This commit is contained in:
@@ -107,16 +107,9 @@ class bam_utils:
|
|||||||
def __new__(cls, *args, **kwargs):
|
def __new__(cls, *args, **kwargs):
|
||||||
raise RuntimeError("%s should not be instantiated" % cls)
|
raise RuntimeError("%s should not be instantiated" % cls)
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def session_find_url():
|
|
||||||
return "http://localhost:5000"
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def session_request_url(req_path):
|
def session_request_url(req_path):
|
||||||
# TODO, get from config
|
|
||||||
cfg = bam_config.load()
|
cfg = bam_config.load()
|
||||||
|
|
||||||
BAM_SERVER = bam_utils.session_find_url()
|
|
||||||
result = "%s/%s" % (cfg['url'], req_path)
|
result = "%s/%s" % (cfg['url'], req_path)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@@ -140,15 +133,14 @@ class bam_utils:
|
|||||||
# Add a config file with project url, username and password
|
# Add a config file with project url, username and password
|
||||||
bam_config.write(
|
bam_config.write(
|
||||||
"config",
|
"config",
|
||||||
{"url":url,
|
{"url": url,
|
||||||
"user":"bam",
|
"user": "bam",
|
||||||
"password":"bam",
|
"password": "bam",
|
||||||
"config_version":1
|
"config_version": 1
|
||||||
},
|
},
|
||||||
cwd=bam_folder)
|
cwd=bam_folder)
|
||||||
|
|
||||||
|
print("Project %r initialized" % project_directory_name)
|
||||||
print("Project %s initialized" % project_directory_name)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def checkout(paths):
|
def checkout(paths):
|
||||||
@@ -314,7 +306,6 @@ class bam_utils:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def list_dir(paths):
|
def list_dir(paths):
|
||||||
import sys
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
# Load project configuration
|
# Load project configuration
|
||||||
@@ -490,7 +481,6 @@ def create_argparse_deps(subparsers):
|
|||||||
|
|
||||||
|
|
||||||
def create_argparse():
|
def create_argparse():
|
||||||
import os
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
usage_text = (
|
usage_text = (
|
||||||
@@ -503,7 +493,8 @@ def create_argparse():
|
|||||||
subparsers = parser.add_subparsers(
|
subparsers = parser.add_subparsers(
|
||||||
title='subcommands',
|
title='subcommands',
|
||||||
description='valid subcommands',
|
description='valid subcommands',
|
||||||
help='additional help')
|
help='additional help',
|
||||||
|
)
|
||||||
|
|
||||||
create_argparse_init(subparsers)
|
create_argparse_init(subparsers)
|
||||||
create_argparse_checkout(subparsers)
|
create_argparse_checkout(subparsers)
|
||||||
@@ -533,4 +524,3 @@ def main():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user