1381 "__pycache__/", |
1381 "__pycache__/", |
1382 "*.DS_Store", |
1382 "*.DS_Store", |
1383 ] |
1383 ] |
1384 |
1384 |
1385 ignoreName = os.path.join(name, Git.IgnoreFileName) |
1385 ignoreName = os.path.join(name, Git.IgnoreFileName) |
1386 if os.path.exists(ignoreName): |
1386 res = ( |
1387 res = E5MessageBox.yesNo( |
1387 E5MessageBox.yesNo( |
1388 self.__ui, |
1388 self.__ui, |
1389 self.tr("Create {0} file").format(ignoreName), |
1389 self.tr("Create {0} file").format(ignoreName), |
1390 self.tr("""<p>The file <b>{0}</b> exists already.""" |
1390 self.tr("""<p>The file <b>{0}</b> exists already.""" |
1391 """ Overwrite it?</p>""").format(ignoreName), |
1391 """ Overwrite it?</p>""").format(ignoreName), |
1392 icon=E5MessageBox.Warning) |
1392 icon=E5MessageBox.Warning) |
1393 else: |
1393 if os.path.exists(ignoreName) else |
1394 res = True |
1394 True |
|
1395 ) |
1395 if res: |
1396 if res: |
1396 try: |
1397 try: |
1397 # create a .gitignore file |
1398 # create a .gitignore file |
1398 with open(ignoreName, "w") as ignore: |
1399 with open(ignoreName, "w") as ignore: |
1399 ignore.write("\n".join(ignorePatterns)) |
1400 ignore.write("\n".join(ignorePatterns)) |