Skip to content

Commit

Permalink
Set version 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
t3eHawk committed Dec 12, 2022
1 parent 212274c commit fe1d077
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 56 deletions.
2 changes: 1 addition & 1 deletion pydin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .vars import run_id, task_id, step_id, process_id


__version__ = '0.1.0'
__version__ = '0.1.1'
__status__ = 'Development'

__author__ = 'Timur Faradzhov'
Expand Down
132 changes: 77 additions & 55 deletions pydin/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,31 @@ def create_scheduler(self, name=None, desc=None, path=None):
logger.debug(f'File {dest} created')
else:
raise Exception(f'file {dest} already exists!')
config_path = os.path.join(root, 'pydin.ini')
config_local = configparser.ConfigParser()
config_dict = {'SCHEDULER': {'scheduler_name': name or '',
'scheduler_desc': desc or '',
'chargers_number': '5',
'executors_number': '20',
'refresh_interval': '300',
'rerun_delay': '14400',
'rerun_interval': '3600',
'wakeup_interval': '60'
},
'LOGGING': {'console': 'True',
'file': 'True',
'info': 'True',
'debug': 'False',
'error': 'True',
'warning': 'True',
'critical': 'True',
'alarming': 'False',
'maxsize': '10485760',
'maxdays': '1'}}
config_path = os.path.join(root, 'pydin.ini')
config_dict = {
'SCHEDULER': {
'scheduler_name': name or '',
'scheduler_desc': desc or '',
'chargers_number': '5',
'executors_number': '20',
'refresh_interval': '300',
'rerun_delay': '14400',
'rerun_interval': '3600',
'wakeup_interval': '60'
},
'LOGGING': {
'console': 'True',
'file': 'True',
'info': 'True',
'debug': 'False',
'error': 'True',
'warning': 'True',
'critical': 'True',
'alarming': 'False',
'maxsize': '10485760',
'maxdays': '1'}
}
config_local.read_dict(config_dict)
with open(config_path, 'w') as fh:
config_local.write(fh, space_around_delimiters=False)
Expand Down Expand Up @@ -209,18 +213,24 @@ def create_job(self, name=None, desc=None, mday=None, wday=None,

config_path = os.path.join(folder, 'pydin.ini')
config_local = configparser.ConfigParser()
config_dict = {'JOB': {},
'LOGGING': {'console': 'True',
'file': 'True',
'info': 'True',
'debug': 'False',
'error': 'True',
'warning': 'True',
'critical': 'True',
'alarming': 'True',
'maxsize': '10485760',
'maxdays': '1'},
'EMAIL': {'toggle': 'True'}}
config_dict = {
'JOB': {},
'LOGGING': {
'console': 'True',
'file': 'True',
'info': 'True',
'debug': 'False',
'error': 'True',
'warning': 'True',
'critical': 'True',
'alarming': 'True',
'maxsize': '10485760',
'maxdays': '1'
},
'EMAIL': {
'toggle': 'True'
}
}
config_local.read_dict(config_dict)
with open(config_path, 'w') as fh:
config_local.write(fh, space_around_delimiters=False)
Expand Down Expand Up @@ -444,29 +454,41 @@ def create_config(self):
raise Exception(f'file {config_path} already exists!')
else:
config_parser = configparser.ConfigParser()
config_dict = {'GENERAL': {'debug': '',
'editor': '',
'owner': ''},
'DATABASE': {'vendor': '',
'driver': '',
'path': '',
'host': '',
'port': '',
'sid': '',
'service': '',
'user': '',
'password': ''},
'EMAIL': {'toggle': '',
'host': '',
'port': '',
'tls': '',
'address': '',
'user': '',
'password': ''},
'API': {'host': '',
'port': '',
'token': ''},
'ENVIRONMENTS': {'python': sys.executable}}
config_dict = {
'GENERAL': {
'debug': '',
'editor': '',
'owner': ''
},
'DATABASE': {
'vendor': '',
'driver': '',
'path': '',
'host': '',
'port': '',
'sid': '',
'service': '',
'user': '',
'password': ''
},
'EMAIL': {
'toggle': '',
'host': '',
'port': '',
'tls': '',
'address': '',
'user': '',
'password': ''
},
'API': {
'host': '',
'port': '',
'token': ''
},
'ENVIRONMENTS': {
'python': sys.executable
}
}
config_parser.read_dict(config_dict)
with open(config_path, 'w') as fh:
config_parser.write(fh, space_around_delimiters=False)
Expand Down

0 comments on commit fe1d077

Please sign in to comment.