|
Lines 46-52
import sys
Link Here
|
| 46 |
ucr = ConfigRegistry() |
46 |
ucr = ConfigRegistry() |
| 47 |
|
47 |
|
| 48 |
# global hashes |
48 |
# global hashes |
| 49 |
include = set() |
|
|
| 50 |
shares = {} |
49 |
shares = {} |
| 51 |
globals = {} |
50 |
globals = {} |
| 52 |
printers = {} |
51 |
printers = {} |
|
Lines 343-357
class ShareConfiguration( object ):
Link Here
|
| 343 |
self.delete() |
342 |
self.delete() |
| 344 |
|
343 |
|
| 345 |
# write conf file with global options |
344 |
# write conf file with global options |
| 346 |
if len( globals ): |
345 |
if len( self.globals ): |
| 347 |
fd = file( ShareConfiguration.GLOBAL_CONF, 'w' ) |
346 |
fd = file( ShareConfiguration.GLOBAL_CONF, 'w' ) |
| 348 |
try: |
347 |
try: |
| 349 |
fd.write("[global]\n") |
348 |
fd.write("[global]\n") |
| 350 |
fd.write( ''.join( map( lambda item: '%s = %s\n' % item, globals.items() ) ) ) |
349 |
fd.write( ''.join( map( lambda item: '%s = %s\n' % item, self.globals.items() ) ) ) |
| 351 |
finally: |
350 |
finally: |
| 352 |
fd.close() |
351 |
fd.close() |
| 353 |
|
352 |
|
| 354 |
include.add( 'include = %s' % ShareConfiguration.GLOBAL_CONF ) |
353 |
includes.add( 'include = %s' % ShareConfiguration.GLOBAL_CONF ) |
| 355 |
|
354 |
|
| 356 |
# write share configs files with options and invalid users |
355 |
# write share configs files with options and invalid users |
| 357 |
for share in self._shares.values(): |
356 |
for share in self._shares.values(): |