src/eric7/RemoteServerInterface/EricServerFileSystemInterface.py

branch
eric7
changeset 10949
2057b1b198a5
parent 10770
8b4ff92221da
child 11040
a4fd43ac7923
equal deleted inserted replaced
10948:89b36a39fe69 10949:2057b1b198a5
58 self.__serverInterface.connectionStateChanged.connect( 58 self.__serverInterface.connectionStateChanged.connect(
59 self.__connectionStateChanged 59 self.__connectionStateChanged
60 ) 60 )
61 61
62 self.__serverPathSep = self.__getPathSep() 62 self.__serverPathSep = self.__getPathSep()
63
64 def serverInterface(self):
65 """
66 Public method to get a reference to the server interface object.
67
68 @return reference to the server interface object
69 @rtype EricServerInterface
70 """
71 return self.__serverInterface
63 72
64 def __hasMagic(self, pathname): 73 def __hasMagic(self, pathname):
65 """ 74 """
66 Private method to check, if a given path contains glob style magic characters. 75 Private method to check, if a given path contains glob style magic characters.
67 76
572 581
573 loop.exec() 582 loop.exec()
574 583
575 return accessOK 584 return accessOK
576 585
577 def mkdir(self, directory): 586 def mkdir(self, directory, mode=0o777):
578 """ 587 """
579 Public method to create a new directory on the eric-ide server. 588 Public method to create a new directory on the eric-ide server.
580 589
581 @param directory absolute path of the new directory 590 @param directory absolute path of the new directory
582 @type str 591 @type str
592 @param mode permissions value (defaults to 0o777)
593 @type int
583 @return tuple containing an OK flag and an error string in case of an issue 594 @return tuple containing an OK flag and an error string in case of an issue
584 @rtype tuple of (bool, str) 595 @rtype tuple of (bool, str)
585 """ 596 """
586 loop = QEventLoop() 597 loop = QEventLoop()
587 ok = False 598 ok = False
606 617
607 if self.__serverInterface.isServerConnected(): 618 if self.__serverInterface.isServerConnected():
608 self.__serverInterface.sendJson( 619 self.__serverInterface.sendJson(
609 category=EricRequestCategory.FileSystem, 620 category=EricRequestCategory.FileSystem,
610 request="Mkdir", 621 request="Mkdir",
611 params={"directory": FileSystemUtilities.plainFileName(directory)}, 622 params={
623 "directory": FileSystemUtilities.plainFileName(directory),
624 "mode": mode,
625 },
612 callback=callback, 626 callback=callback,
613 ) 627 )
614 628
615 loop.exec() 629 loop.exec()
616 if ok: 630 if ok:

eric ide

mercurial