src/eric7/Graphics/PackageDiagramBuilder.py

branch
server
changeset 10596
ea35c92a3c7c
parent 10585
83e5a9a64543
child 10604
0f4017309f35
equal deleted inserted replaced
10594:6156d9675f62 10596:ea35c92a3c7c
181 self.__remotefsInterface.glob( 181 self.__remotefsInterface.glob(
182 self.__remotefsInterface.join( 182 self.__remotefsInterface.join(
183 subpackage["path"], "__init__.*" 183 subpackage["path"], "__init__.*"
184 ) 184 )
185 ) 185 )
186 ) != 0 186 )
187 != 0
187 ): 188 ):
188 subpackagesList.append( 189 subpackagesList.append(
189 FileSystemUtilities.remoteFileName(subpackage["path"]) 190 FileSystemUtilities.remoteFileName(subpackage["path"])
190 ) 191 )
191 else: 192 else:
192 with os.scandir(self.package) as dirEntriesIterator: 193 with os.scandir(self.package) as dirEntriesIterator:
193 for subpackage in dirEntriesIterator: 194 for subpackage in dirEntriesIterator:
194 if ( 195 if (
195 subpackage.is_dir() 196 subpackage.is_dir()
196 and subpackage.name != "__pycache__" 197 and subpackage.name != "__pycache__"
197 and len(glob.glob(os.path.join(subpackage.path, "__init__.*"))) != 0 198 and len(glob.glob(os.path.join(subpackage.path, "__init__.*")))
199 != 0
198 ): 200 ):
199 subpackagesList.append(subpackage.path) 201 subpackagesList.append(subpackage.path)
200 202
201 tot = 0 203 tot = 0
202 for ext in supportedExt: 204 for ext in supportedExt:
278 The algorithm is borrowed from Boa Constructor. 280 The algorithm is borrowed from Boa Constructor.
279 """ 281 """
280 self.allClasses = {} 282 self.allClasses = {}
281 283
282 globPattern = os.path.join(self.package, "__init__.*") 284 globPattern = os.path.join(self.package, "__init__.*")
283 if FileSystemUtilities.isRemoteFileName(self.package): 285 initlist = (
284 initlist = self.__remotefsInterface.glob(globPattern) 286 self.__remotefsInterface.glob(globPattern)
285 else: 287 if FileSystemUtilities.isRemoteFileName(self.package)
286 initlist = glob.glob(globPattern) 288 else glob.glob(globPattern)
289 )
287 if len(initlist) == 0: 290 if len(initlist) == 0:
288 ct = QGraphicsTextItem(None) 291 ct = QGraphicsTextItem(None)
289 self.scene.addItem(ct) 292 self.scene.addItem(ct)
290 ct.setHtml( 293 ct.setHtml(
291 self.tr("The directory <b>'{0}'</b> is not a package.").format( 294 self.tr("The directory <b>'{0}'</b> is not a package.").format(

eric ide

mercurial