christianmlong + filesystem   14

entr(1)
Run tests when a file changes

find . -name '*.py' | entr python runTests.py --pytest-only
filesystem  utility  watch  run  tests 
november 2016 by christianmlong
mrozekma/SE-Fuse
Python implementation of a Fuse filesystem. The "filesystem" presents an interface to the Stack Exchange web api.
python  fuse  api  filesystem  stack  overflow  exchange  example 
october 2016 by christianmlong
Python: import module from another directory at the same level in project hierarchy - Stack Overflow
In summary, the hierarchy I would use is:

user_management (package)
|
|------- __init__.py
|
|------- Modules/
| |
| |----- __init__.py
| |----- LDAPManager.py
| |----- PasswordManager.py
|

Scripts/ (*not* a package)
|
|----- CreateUser.py
|----- FindUser.py

Then the code of CreateUser.py and FindUser.py should use absolute imports to import the modules:

from user_management.Modules import LDAPManager

During installation you make sure that user_management ends up somewhere in the PYTHONPATH, and the scripts inside the directory for executables so that they are able to find the modules.
python  path  absolute  relative  import  filesystem  structure  hierarchy  package 
august 2016 by christianmlong
filesystems - Using File Date/Time as Metadata: Reliable? - Unix & Linux Stack Exchange
Validate your filesystem's granularity of timestamping by doing something like touch a ; sleep 0.1s ; touch b ; stat -c '%y' a b
linux  osx  stat  mtime  ctime  atime  resolution  file  FileSystem 
february 2016 by christianmlong
Interesting Things, Largely Python and Twisted Related: Filesystem structure of a Python project
Filesystem structure of a Python project
Do:

name the directory something related to your project. For example, if your project is named "Twisted", name the top-level directory for its source files Twisted. When you do releases, you should include a version number suffix: Twisted-2.5.
create a directory Twisted/bin and put your executables there, if you have any. Don't give them a .py extension, even if they are Python source files. Don't put any code in them except an import of and call to a main function defined somewhere else in your projects. (Slight wrinkle: since on Windows, the interpreter is selected by the file extension, your Windows users actually do want the .py extension. So, when you package for Windows, you may want to add it. Unfortunately there's no easy distutils trick that I know of to automate this process. Considering that on POSIX the .py extension is a only a wart, whereas on Windows the lack is an actual bug, if your userbase includes Windows users, you may want to opt to just have the .py extension everywhere.)
If your project is expressable as a single Python source file, then put it into the directory and name it something related to your project. For example, Twisted/twisted.py. If you need multiple source files, create a package instead (Twisted/twisted/, with an empty Twisted/twisted/__init__.py) and place your source files in it. For example, Twisted/twisted/internet.py.
put your unit tests in a sub-package of your package (note - this means that the single Python source file option above was a trick - you always need at least one other file for your unit tests). For example, Twisted/twisted/test/. Of course, make it a package with Twisted/twisted/test/__init__.py. Place tests in files like Twisted/twisted/test/test_internet.py.
add Twisted/README and Twisted/setup.py to explain and install your software, respectively, if you're feeling nice.

Don't:

put your source in a directory called src or lib. This makes it hard to run without installing.
put your tests outside of your Python package. This makes it hard to run the tests against an installed version.
create a package that only has a __init__.py and then put all your code into __init__.py. Just make a module instead of a package, it's simpler.
try to come up with magical hacks to make Python able to import your module or package without having the user add the directory containing it to their import path (either via PYTHONPATH or some other mechanism). You will not correctly handle all cases and users will get angry at you when your software doesn't work in their environment.
python  exarkun  twisted  directory  filesystem  structure  __init__.py  import  module  package 
september 2015 by christianmlong
Configure File System Permissions for Database Engine Access
To Grant File System Permission to the Per-service SID

Using Windows Explorer, navigate to the file system location where the database files are stored. Right-click the file system folder, and then click Properties.

On the Security tab, click Edit, and then Add.

In the Select Users, Computer, Service Account, or Groups dialog box, click Locations, at the top of the location list, select your computer name, and then click OK.

In the Enter the object names to select box, type the name of the per-service SID listed in the Books Online topic Configure Windows Service Accounts and Permissions. (For the Database Engine per service SID, use NT SERVICE\MSSQLSERVER for a default instance, or NT SERVICE\MSSQL$InstanceName for a named instance.)

Click Check Names to validate the entry. The validation often fails, and might advise you that the name was not found. When you click OK, a Multiple Names Found dialog box appears.

Now select the per-service SID, either MSSQLSERVER or NT SERVICE\MSSQL$InstanceName, and then click OK.

Click OK again to return to the Permissions dialog box.

In the Group or user names box, select the per-service SID, and then in the Permissions for <name> box, select the Allow check box for Full control.

Click Apply, and then click OK twice to exit.
Windows  virtual  service  account  filesystem  permissions  privilege 
january 2015 by christianmlong

Copy this bookmark:



description:


tags: