comparison sat_frontends/jp/cmd_merge_request.py @ 4037:524856bd7b19

massive refactoring to switch from camelCase to snake_case: historically, Libervia (SàT before) was using camelCase as allowed by PEP8 when using a pre-PEP8 code, to use the same coding style as in Twisted. However, snake_case is more readable and it's better to follow PEP8 best practices, so it has been decided to move on full snake_case. Because Libervia has a huge codebase, this ended with a ugly mix of camelCase and snake_case. To fix that, this patch does a big refactoring by renaming every function and method (including bridge) that are not coming from Twisted or Wokkel, to use fully snake_case. This is a massive change, and may result in some bugs.
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:54:42 +0200
parents 5f65f4e9f8cb
children 4b842c1fb686
comparison
equal deleted inserted replaced
4036:c4464d7ae97b 4037:524856bd7b19
74 if not self.args.force: 74 if not self.args.force:
75 message = _( 75 message = _(
76 "You are going to publish your changes to service " 76 "You are going to publish your changes to service "
77 "[{service}], are you sure ?" 77 "[{service}], are you sure ?"
78 ).format(service=self.args.service) 78 ).format(service=self.args.service)
79 await self.host.confirmOrQuit( 79 await self.host.confirm_or_quit(
80 message, _("merge request publication cancelled") 80 message, _("merge request publication cancelled")
81 ) 81 )
82 82
83 extra = {"update": True} if self.args.item else {} 83 extra = {"update": True} if self.args.item else {}
84 values = {} 84 values = {}
85 if self.args.labels is not None: 85 if self.args.labels is not None:
86 values["labels"] = self.args.labels 86 values["labels"] = self.args.labels
87 try: 87 try:
88 published_id = await self.host.bridge.mergeRequestSet( 88 published_id = await self.host.bridge.merge_request_set(
89 self.args.service, 89 self.args.service,
90 self.args.node, 90 self.args.node,
91 self.repository, 91 self.repository,
92 "auto", 92 "auto",
93 values, 93 values,
131 async def start(self): 131 async def start(self):
132 await common.fill_well_known_uri(self, os.getcwd(), "merge requests", meta_map={}) 132 await common.fill_well_known_uri(self, os.getcwd(), "merge requests", meta_map={})
133 extra = {} 133 extra = {}
134 try: 134 try:
135 requests_data = data_format.deserialise( 135 requests_data = data_format.deserialise(
136 await self.host.bridge.mergeRequestsGet( 136 await self.host.bridge.merge_requests_get(
137 self.args.service, 137 self.args.service,
138 self.args.node, 138 self.args.node,
139 self.args.max, 139 self.args.max,
140 self.args.items, 140 self.args.items,
141 "", 141 "",
184 await common.fill_well_known_uri( 184 await common.fill_well_known_uri(
185 self, self.repository, "merge requests", meta_map={} 185 self, self.repository, "merge requests", meta_map={}
186 ) 186 )
187 extra = {} 187 extra = {}
188 try: 188 try:
189 await self.host.bridge.mergeRequestsImport( 189 await self.host.bridge.merge_requests_import(
190 self.repository, 190 self.repository,
191 self.args.item, 191 self.args.item,
192 self.args.service, 192 self.args.service,
193 self.args.node, 193 self.args.node,
194 extra, 194 extra,