Skip to content

Commit ccbb0cb

Browse files
Fix unnecessary file IO, improve logging (#149)
* Fix unnecessary file IO, improve logging * Lint * Changelog
1 parent 37a8de9 commit ccbb0cb

File tree

11 files changed

+15
-18
lines changed

11 files changed

+15
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [unreleased]
44

5+
### Fixed
6+
7+
* Removed unnecessary file IO calls, improved logging
8+
59
## 3.0.3 - 2021-10-01
610

711
### Fixed
File renamed without changes.

src/demo_quipuswap/sql/.keep

Whitespace-only changes.

src/demo_registrydao/dipdup.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ indexes:
4747
pattern:
4848
- type: origination
4949
similar_to: registry
50-
stateless: True

src/demo_registrydao/sql/.keep

Whitespace-only changes.

src/demo_tezos_domains/sql/.keep

Whitespace-only changes.

src/demo_tezos_domains_big_map/sql/.keep

Whitespace-only changes.

src/demo_tzbtc/sql/.keep

Whitespace-only changes.

src/demo_tzcolors/sql/.keep

Whitespace-only changes.

src/dipdup/codegen.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,27 @@ async def docker_init(self, image: str, tag: str, env_file: str) -> None:
9696

9797
async def create_package(self) -> None:
9898
"""Create Python package skeleton if not exists"""
99-
self._logger.info('Creating package `%s`', self._config.package)
10099
try:
101100
package_path = self._config.package_path
102101
except ImportError:
102+
self._logger.info('Creating package `%s`', self._config.package)
103103
package_path = join(os.getcwd(), self._config.package)
104-
touch(join(package_path, '__init__.py'))
105104

106-
self._logger.info('Creating `%s.models` module', self._config.package)
105+
touch(join(package_path, '__init__.py'))
106+
107107
models_path = join(package_path, 'models.py')
108108
if not exists(models_path):
109109
template = load_template('models.py')
110110
models_code = template.render()
111111
write(models_path, models_code)
112112

113113
for subpackage in ('handlers', 'hooks'):
114-
self._logger.info('Creating `%s.%s` package', self._config.package, subpackage)
115114
subpackage_path = join(self._config.package_path, subpackage)
116115
touch(join(subpackage_path, '__init__.py'))
117116

118-
self._logger.info('Creating `%s/sql` directory', self._config.package)
119117
sql_path = join(self._config.package_path, 'sql')
120-
touch(join(sql_path, 'on_restart', '.keep'))
121-
touch(join(sql_path, 'on_reindex', '.keep'))
118+
touch(join(sql_path, '.keep'))
122119

123-
self._logger.info('Creating `%s/graphql` directory', self._config.package)
124120
graphql_path = join(self._config.package_path, 'graphql')
125121
touch(join(graphql_path, '.keep'))
126122

0 commit comments

Comments
 (0)