Can I add a relative path to directory to add a repository to Trac? - trac

I am able to add a absolute path directory for the trac repository. When I give a relative path, It is not accepting it. Is there any config which I am missing for this in Trac?

Only absolute paths are allowed. I've considered looking into whether this restriction can be removed. What would your path be relative to? The environment directory?

Related

How can I change the log directory?

By default, the logging directory in Shopware6 is var/log.
How can I change it to something different like /var/log/shopware6 without creating a symlink?
That directory is a Symfony default. You can change it by setting an environment variable APP_LOG_DIR with an absolute path to a writable directory e.g. in you .env file.

WebStorm run configuration - package.json path relative to project directory

Question: In WebStorm's npm run configuration: How to make the package.json path relative to project directory?
Goal: To be able to share the run configuration in VCS, it must not depend on where the project is on my machine.
Screenshot: I.e., I want to change ~\WebStormProjects\x-nest\ to PROJECT_DIR\.
package.json field doesn't support variables; but you do not need to use macros or do anything at all to make configurations shareable, this case is handled automatically: if you look inside the .idea/workspace.xml (or .idea\runConfigurations\<config name>.xml if Share through VCS is enabled for it) file you'll notice that IDE stores this path as $PROJECT_DIR$/path/to/package.json, like:
<package-json value="$PROJECT_DIR$/package.json" />
So you can safely keep this .xml file under Version Control and your colleagues will have the correct path to the file even if local path to project is different.

Apache server cannot find local file [duplicate]

I'm working on a Flask extension from which I want to create a directory in the project's root path on the file system.
Suppose we have this directory structure
/project
/app
/tests
/my_folder
manage.py
my_folder should be created dynamically by the extension, which is a test utility and wraps the application under test in the /tests directory. However, I'm struggling to determine the project's root path within my extension.
For now, I am trying to guess the path from the run file:
def root_path(self):
# Infer the root path from the run file in the project root (e.g. manage.py)
fn = getattr(sys.modules['__main__'], '__file__')
root_path = os.path.abspath(os.path.dirname(fn))
return root_path
This obviously breaks as soon as the tests are run from within the IDE instead of the manage.py. I could simply infer the project's root relative to the app or tests directory, but I don't want to make any assumptions regarding the name or structure of these directories (since multiple apps might be hosted as subpackages in a single package).
I was wondering if there is a best practice for this type of problem or an undocumented method which the Flask object provides (such as get_root_path).
app.root_path contains the root path for the application. This is determined based on the name passed to Flask. Typically, you should use the instance path (app.instance_path) not the root path, as the instance path will not be within the package code.
filename = os.path.join(app.instance_path, 'my_folder', 'my_file.txt')
app.root_path is the absolute path to the root directory containing your app code.
app.instance_path is the absolute path to the instance folder. os.path.dirname(app.instance_path) is the directory above the instance folder. During development, this is next to or the same as the root path, depending on your project layout.

Determining whether a file is linked to a project or not

I'm writing a project documenter and I write out the full file path of each compiled file. This is for the VB.NET language so .proj files are written in xml.
Any file that is linked to the project exists on the same drive so at least one of the directory levels are the same for all files. I currently have it set up to put the project directory path on files which exist inside the project since it only shows the name of the file and the residing directory it lives in if its in a directory inside the project. For files outside (linked in) to the project I initially saw their files paths were "..\..\..\dir\filename". So I set it up to take off all the "..\" and put the necessary directories in front of it and all that worked fine. Now for this one .proj file some of the linked in files have their full file path with no "..\".
How can I properly distinguish these three possible inputs?
System.IO.Path.IsRooted will tell you whether a path is rooted, i.e. is a full path, or not. If the path is not rooted it is a relative path. You can use Path.Combine to resolve the full path from a relative path.

IntelliJ include a directory contained in an excluded directory?

Can IntelliJ include a source directory contained in an excluded directory?
I am using Google Protocol Buffers and am placing the generated class files in the target/proto-generated directory. I have already excluded the target directory, is there a way to mark proto-generated as a source directory and leave the target directory excluded?
target <excluded>
classes
proto-generated <include>
Thanks CrazyCoder for
"See youtrack.jetbrains.com/issue/IDEABKL-6054 for the workaround."